comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
April 2008
motuwethfrsasuw
 123456 14
78910111213 15
14151617181920 16
21222324252627 17
282930     18
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Filesystem Notification         


Author: vivekian
Date: Apr 7, 2008 15:48

Hi,

Writing a small application which requires the application to be
informed when the content / filename / location of a particular file
changes. Is there a Win32 class available which does this ?

Thanks in advance,
vivekian
11 Comments
  Cannot redirect standard output to file         


Author: andreyvul
Date: Apr 7, 2008 12:37

I'm using CreateProcess to launch a program with redirect standard
output. CreateFile works, but output file is 0 bytes long.
main program:
#include
#include
in main(int argc, char *argv[]) {
HANDLE hNewStdOut, hNewStdIn, hNewStdErr;
STARTUPINFO si;
PROCESS_INFORMATION pi;
char newstdout[] = "..\\out.txt";
Show full article (1.25Kb)
5 Comments
  problem setting font size on a subclassed edit control         


Author: Jack
Date: Apr 7, 2008 12:25

Hi,

I have subclassed an edit control so that I can control it's colouring - in
particular when it is disabled - copied below.

I perform the colouring and text output (DrawText() ) in an overridden
WM_PAINT.

The colours work fine, however I can't get the text to be the same size as
the text in other edit controls on the dialog which are default size, it is
slightly bigger.

I have tried to GetDC for the dialog and create a font from that but the
textmetrics returned are of the slightly bigger size.

I have tried to see what happens if I use the dc from certain windows
messages that send a dc eg:

WM_CTLCOLOREDIT and WM_CTLCOLORSTATIC but they are not received by the
subclass.

All I seem to receive are WM_PAINT and WM_ERASEBACKGROUND and WM_DESTROY -
the control properties is set to disabled state.

I can set the font successfully in the WM_PAINT for the control with a
hard-coded font size, but I want to automatically have the font sizes equal.

TIA for any ideas.
Show full article (2.49Kb)
1 Comment
  Is there a "fudge factor" applied to the backlog on listen()         


Author: Andrew Falanga
Date: Apr 7, 2008 11:24

Hi,

On my server, I make my socket, call bind( ) and then listen( ) with a
backlog argument to listen of 5. Then, I place the server in a state
where it will not accept( ) incoming connections for a period of
time. Then, on the client, I make 6 connections to the server. On
the sixth, I'm expecting WSAECONNREFUSED, but I'm not getting that.
I'm still getting WSAEWOULDBLOCK. On each socket created in the
client application, the sockets are being made non-blocking.

I'm wondering, is there a "fudge factor" applied to the backlog
argument such as is done in FreeBSD? From the listen(2) manual of
FreeBSD, "The real maximum queue length will be 1.5 times more than
the value specified in the backlog argument." On this link in MSDN, I
can't find anything like that but wanted to ask here.

http://msdn2.microsoft.com/en-us/library/ms739168(VS.85).aspx

Of course, it's entirely possible the problem is something else I've
completely missed.

Thanks,
Andy
3 Comments
  Static Rich Edit Control         


Author: Aaron Moore
Date: Apr 7, 2008 11:20

Hello everyone,
I was referenced here from GameDev.net by a user responding to a
question I asked on those forums. I apologize ahead of time if my question
is one asked and answered often.

I'm looking to display rich edit text in a window and have the text act like
a static control. ES_READONLY still allows the control to recieve mouse
input and highlighting. WS_DISABLED greys out the window.

Is there an easy method of accomplishing this while retaining the ability to
use rich text formatting?
2 Comments
  Is it possible to reposition window's menu bar?         


Author: Alex Blekhman
Date: Apr 7, 2008 10:26

Hello,

I have a requirement to make custom non-client area for main
window. I handle the WM_NCPAINT message and draw window frame
including window caption correctly. However, window's menu bar
cannot be replaced and happens to be under the caption (custom
caption is higher than the system one).

I tried to make owner-draw menu following the description from
MSDN:

"Using Menus" (section "Creating Owner-Drawn Menu Items")
http://msdn2.microsoft.com/en-us/library/ms647558.aspx

However, I never get a chance to set new position for the menu
bar. All I get is the WM_MEASUREITEM message where I can set
height and width of individual menu item. And then the WM_DRAWITEM
message where I should draw the item on a given DC.

I have no problem to draw menu items' text at the arbitrary
location of non-client area, but I cannot cause it to behave like
a menu bar. Handling WM_NCHITTEST and returning HTMENU has no
effect whatsoever. Should I handle the WM_NCLBUTTONDOWN message,
too? Any other messages?
Show full article (1.06Kb)
2 Comments
  globally-accessible environment variables         


Author: pete
Date: Apr 7, 2008 10:17

Hi folks --

1. There must be a better way to set accessible-by-all-processes
environment variables than by writing the Registry, but that's what it
looks like (from VS2005 online docs) I have to do. Any other ideas
about writing these environment variables? I'd be grateful to hear
them.

2. Absent any new ideas, I'm writing environment variables into the
Registry at

HKLM\SYSTEM\ CurrentControlSet \Control\Session Manager
\Environment

which of course works just dandy for the current (i.e., my) process.

But later _getenv( ) calls by other processes retrieve that
environment variable not from where I wrote it (which I imagined,
without any real knowledge, was the right place) but from:

HKLM\SYSTEM\ ControlSet011 \Control\Session Manager\Environment

What is ControlSet011? Can I depend on it to always hold the variables
I need to save? I thought it was somewhat volatile or capriciously
renamable.

Thanks, everyone.
Show full article (0.95Kb)
2 Comments