Window Messages Help
-
kinglestat
- Enthusiast

- Posts: 746
- Joined: Fri Jul 14, 2006 8:53 pm
- Location: Malta
- Contact:
Window Messages Help
How is it possible to register user created messages for the window message system so that 2 applications can communicate together? And how to capture them in PB? Can't find any examples to help me out
I may not help with your coding
Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
Just ask about mental issues!
http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
Re: Window Messages Help
Just usekinglestat wrote:How is it possible to register user created messages for the window message system so that 2 applications can communicate together? And how to capture them in PB? Can't find any examples to help me out
msg = RegisterWindowMessage_(@"MyUniqueString")
and
PostMessage_(#HWND_BROADCAST,msg, ...)
Code: Select all
If OpenWindow(1, 0, 0, 800, 600, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0,10,10,780,580)
myMessage = RegisterWindowMessage_(@"My.App.Message.1")
PostMessage_(#HWND_BROADCAST,myMessage,12,24)
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Quit = #True
Case myMessage
msg$ = "STRING MESSAGE (RegisterWindowMessage): "
AddGadgetItem(0,-1,msg$+Str(Event)+" ($"+Hex(Event)+") - wParam: "+Str(EventwParam())+" ($"+Hex(EventwParam())+") - lParam: "+Str(EventlParam())+" ($"+Hex(EventlParam())+")")
EndSelect
Until Quit = #True
EndIfRe: Window Messages Help
There is a bug, on window x64 i have one message, on window x86 i have two (same) messages!
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Window Messages Help
You might consider using shared memory (File Mapping):
http://www.purebasic.fr/english/viewtop ... 12&t=51527
http://www.purebasic.fr/english/viewtop ... 12&t=51527
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
