It is currently Tue May 21, 2013 7:25 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [SOLVED] how add own message?
PostPosted: Sun Apr 27, 2008 9:33 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Aug 05, 2003 11:30 pm
Posts: 405
Hello

I have one more question.

How i can add my own message that the my gadget (from my lib) sends to the parent window of the lib?

I want send a message like WM_LBUTTONDBCLK to the callback of the parent window.

Thanks,
Nico

_________________
my live space


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 11:03 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 9870
Location: Beyond the pale...
You can either construct your own messages based upon #WM_USER or #WM_APP, or use RegisterWindowMessage_() to construct a system wide unique message.

Which method you use really depends on the nature of the parent window. Some pre-registered windows classes, e.g. ListView controls (LIstICons), make use of #WM_USER for certain private messages etc. If in doubt, use RegisterWindowMessage_().

**EDIT : if you are creating a custom gadget and wish to send notifications to the parent window, then you may be better off passing a #WM_NOTIFY message.

_________________
I may look like a mule, but I'm not a complete ass.

eScript
Arctic Reports
nxSoftware


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 6:44 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Aug 05, 2003 11:30 pm
Posts: 405
Hm...

I test it so:
in the Res file of the lib i have a constante like this one:
Code:
#TLG_LBUTTONDBCLK = #WM_USER+1

Code inside the lib:
Code:
SendMessage_(*tgm\hWndParent,#TLG_LBUTTONDBCLK,*tgi,0)


Code in the program
Code:
Procedure MyCallBack(wnd,msg,wParam,lParam)
  Select message
    Case #TLG_LBUTTONDBCLK
      Debug "it works"
  EndSelect
  ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure



But if i run the programm with debug it dont show the debug message if i doppelclick in the gadget.

Is my way the right one?

_________________
my live space


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 6:50 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
if you replace message with msg it should work :wink:

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 27, 2008 8:07 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Aug 05, 2003 11:30 pm
Posts: 405
ABBKlaus wrote:
if you replace message with msg it should work :wink:


ups you are right! i must go sleep

_________________
my live space


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye