1. RE: Help with w32Func(xSendMessage,{})
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Mar 22, 2004
- 457 views
> -----Original Message----- > From: CoJaBo [mailto:cojabo at suscom.net] > Subject: Help with w32Func(xSendMessage,{}) > > > > I am using w32Func(xSendMessage,{control,message,w,l}) to > send a simple > command to another program. > I have a few questions: > w32Func(xSendMessage,{control,message,w,l}) > Is there any way to set control to send to all main program windows? The 'control' parameter is the handle of a control. AFAIK, you can use HWND_BROADCAST to send to all main windows currently running. > What can I use for message that won't happen normally and won't mess You can define your own message types. See win32lib to see how we defined one for searching... FINDMSGSTRING = w32acquire_mem(0, "commdlg_FindReplace"), w32FindReplaceMsg = w32Func( RegisterWindowMessage, { FINDMSGSTRING } ) so now one can do ... w32Proc(xSendMessage, {HWND_BROADCAST, w32FindReplaceMsg, w, l }) > How high/low can w and l be? These are 32-bit values, meaning that you can send any integer in the range #00000000 to #FFFFFFFF. -- Derek
2. RE: Help with w32Func(xSendMessage,{})
- Posted by CoJaBo <cojabo at suscom.net> Mar 22, 2004
- 437 views
Derek Parnell wrote: > > > > -----Original Message----- > > From: CoJaBo [mailto:cojabo at suscom.net] > > Sent: Tuesday, 23 March 2004 10:03 AM > > To: EUforum at topica.com > > Subject: Help with w32Func(xSendMessage,{}) > > > > > > I am using w32Func(xSendMessage,{control,message,w,l}) to > > send a simple > > command to another program. > > I have a few questions: > > w32Func(xSendMessage,{control,message,w,l}) > > Is there any way to set control to send to all main program windows? > > The 'control' parameter is the handle of a control. AFAIK, you can use > HWND_BROADCAST to send to all main windows currently running. HWND_BROADCAST has not been declared HWND_BROADCAST ^ Press Enter... Where is it defined? > > > What can I use for message that won't happen normally and won't mess > > You can define your own message types. See win32lib to see how we > defined > one for searching... > > FINDMSGSTRING = w32acquire_mem(0, "commdlg_FindReplace"), > w32FindReplaceMsg = w32Func( RegisterWindowMessage, { > FINDMSGSTRING } ) > > so now one can do ... > > w32Proc(xSendMessage, {HWND_BROADCAST, w32FindReplaceMsg, w, l }) > Exactly what I was looking for. > > > How high/low can w and l be? > > These are 32-bit values, meaning that you can send any integer in the > range > #00000000 to #FFFFFFFF. Thanks > > -- > Derek > >
3. RE: Help with w32Func(xSendMessage,{})
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Mar 22, 2004
- 422 views
> -----Original Message----- > From: CoJaBo [mailto:cojabo at suscom.net] > Subject: RE: Help with w32Func(xSendMessage,{}) > > > > Derek Parnell wrote: > > > > > > > -----Original Message----- > > > From: CoJaBo [mailto:cojabo at suscom.net] > > > Sent: Tuesday, 23 March 2004 10:03 AM > > > To: EUforum at topica.com > > > Subject: Help with w32Func(xSendMessage,{}) > > > > > > > > > I am using w32Func(xSendMessage,{control,message,w,l}) to > > > send a simple > > > command to another program. > > > I have a few questions: > > > w32Func(xSendMessage,{control,message,w,l}) > > > Is there any way to set control to send to all main > program windows? > > > > The 'control' parameter is the handle of a control. AFAIK, > you can use > > HWND_BROADCAST to send to all main windows currently running. > > HWND_BROADCAST has not been declared > HWND_BROADCAST > ^ constant HWND_BROADCAST = #FFFF -- Derek
4. RE: Help with w32Func(xSendMessage,{})
- Posted by CoJaBo <cojabo at suscom.net> Mar 23, 2004
- 425 views
Derek Parnell wrote: > > > > -----Original Message----- > > From: CoJaBo [mailto:cojabo at suscom.net] > > Sent: Tuesday, 23 March 2004 10:30 AM > > To: EUforum at topica.com > > Subject: RE: Help with w32Func(xSendMessage,{}) > > > > > > Derek Parnell wrote: > > > > > > > > > > -----Original Message----- > > > > From: CoJaBo [mailto:cojabo at suscom.net] > > > > Sent: Tuesday, 23 March 2004 10:03 AM > > > > To: EUforum at topica.com > > > > Subject: Help with w32Func(xSendMessage,{}) > > > > > > > > > > > > I am using w32Func(xSendMessage,{control,message,w,l}) to > > > > send a simple > > > > command to another program. > > > > I have a few questions: > > > > w32Func(xSendMessage,{control,message,w,l}) > > > > Is there any way to set control to send to all main > > program windows? > > > > > > The 'control' parameter is the handle of a control. AFAIK, > > you can use > > > HWND_BROADCAST to send to all main windows currently running. > > > > HWND_BROADCAST has not been declared > > HWND_BROADCAST > > ^ > > > constant HWND_BROADCAST = #FFFF > Thanks, it seems to work fine, except for: > so now one can do ... > > w32Proc(xSendMessage, {HWND_BROADCAST, w32FindReplaceMsg, w,l }) This should be w32Func()! > > -- > Derek > >
5. RE: Help with w32Func(xSendMessage,{})
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Mar 23, 2004
- 415 views
> -----Original Message----- > From: CoJaBo [mailto:cojabo at suscom.net] > Subject: RE: Help with w32Func(xSendMessage,{}) > > > > Derek Parnell wrote: [snip] > > > > w32Proc(xSendMessage, {HWND_BROADCAST, > w32FindReplaceMsg, w,l }) > This should be w32Func()! Of course, sorry. You could do something like this so you don't have to process any return value ... xFwdMessage = registerw32Procedure(user32, "SendMessageA", {C_POINTER, C_UINT, C_LONG, C_LONG}) w32Proc(xFwdMessage, { ... }) -- Derek
6. RE: Help with w32Func(xSendMessage,{})
- Posted by Andy Serpa <ac at onehorseshy.com> Mar 23, 2004
- 424 views
Derek -- I was just about to post this on the win32lib beta board, but since you're talking about it here: Is it possible you've declared SendMessage with the wrong return value type? You've got (in w32User.ew): xSendMessage = registerw32Function(user32, "SendMessageA",{C_POINTER, C_UINT, C_LONG, C_LONG}, C_LONG) <= signed int But I was using SendMessage with WM_GETFONT to get Font Handles and I noticed that sometimes they came back as negative numbers (and my fonts weren't what they were supposed to be). I figured that can't be right. I changed the C_LONG return value to C_POINTER (unsigned int) and problem solved. If I am correct and that is an error (and maybe there are other wrong types with some other windows funcs?) then that may be the source of some of the as of yet untracked-down weirdness in win32lib... -- Andy Derek Parnell wrote: > > > > -----Original Message----- > > From: CoJaBo [mailto:cojabo at suscom.net] > > Sent: Tuesday, 23 March 2004 11:02 AM > > To: EUforum at topica.com > > Subject: RE: Help with w32Func(xSendMessage,{}) > > > > > > Derek Parnell wrote: > > [snip] > > > > > > > w32Proc(xSendMessage, {HWND_BROADCAST, > > w32FindReplaceMsg, w,l }) > > This should be w32Func()! > > Of course, sorry. > > You could do something like this so you don't have to process any return > value ... > > xFwdMessage = registerw32Procedure(user32, "SendMessageA", > {C_POINTER, C_UINT, C_LONG, C_LONG}) > > w32Proc(xFwdMessage, { ... }) > > -- > Derek > >
7. RE: Help with w32Func(xSendMessage,{})
- Posted by Brian Broker <bkb at cnw.com> Mar 23, 2004
- 400 views
It's very likely. Most of these declarations are from the David Cuny days and a handful of incorrect types have already been identified. -- Brian Andy Serpa wrote: > > > Derek -- > > I was just about to post this on the win32lib beta board, but since > you're talking about it here: > > Is it possible you've declared SendMessage with the wrong return value > type? > > You've got (in w32User.ew): > > xSendMessage = registerw32Function(user32, > "SendMessageA",{C_POINTER, C_UINT, C_LONG, C_LONG}, C_LONG) <= signed > int > > > But I was using SendMessage with WM_GETFONT to get Font Handles and I > noticed that sometimes they came back as negative numbers (and my fonts > weren't what they were supposed to be). I figured that can't be right. > > I changed the C_LONG return value to C_POINTER (unsigned int) and > problem solved. > > If I am correct and that is an error (and maybe there are other wrong > types with some other windows funcs?) then that may be the source of > some of the as of yet untracked-down weirdness in win32lib... > > -- Andy > > > Derek Parnell wrote: > > > > > > > -----Original Message----- > > > From: CoJaBo [mailto:cojabo at suscom.net] > > > Sent: Tuesday, 23 March 2004 11:02 AM > > > To: EUforum at topica.com > > > Subject: RE: Help with w32Func(xSendMessage,{}) > > > > > > > > > Derek Parnell wrote: > > > > [snip] > > > > > > > > > > w32Proc(xSendMessage, {HWND_BROADCAST, > > > w32FindReplaceMsg, w,l }) > > > This should be w32Func()! > > > > Of course, sorry. > > > > You could do something like this so you don't have to process any return > > value ... > > > > xFwdMessage = registerw32Procedure(user32, "SendMessageA", > > {C_POINTER, C_UINT, C_LONG, C_LONG}) > > > > w32Proc(xFwdMessage, { ... }) > > > > -- > > Derek > > > >
8. RE: Help with w32Func(xSendMessage,{})
- Posted by Brian Broker <bkb at cnw.com> Mar 23, 2004
- 424 views
Actually, I think that the params should also be UINT's because they are frequently pointers... xSendMessage = registerw32Function(user32, "SendMessageA",{C_POINTER, C_UINT, C_UINT, C_UINT}, C_UINT) -- Brian Andy Serpa wrote: > > > Derek -- > > I was just about to post this on the win32lib beta board, but since > you're talking about it here: > > Is it possible you've declared SendMessage with the wrong return value > type? > > You've got (in w32User.ew): > > xSendMessage = registerw32Function(user32, > "SendMessageA",{C_POINTER, C_UINT, C_LONG, C_LONG}, C_LONG) <= signed > int > > > But I was using SendMessage with WM_GETFONT to get Font Handles and I > noticed that sometimes they came back as negative numbers (and my fonts > weren't what they were supposed to be). I figured that can't be right. > > I changed the C_LONG return value to C_POINTER (unsigned int) and > problem solved. > > If I am correct and that is an error (and maybe there are other wrong > types with some other windows funcs?) then that may be the source of > some of the as of yet untracked-down weirdness in win32lib... > > -- Andy