how to post message to a button which is being created

Hi,All
      I get the button Hwnd which is being created via hook. I want to
send message to this button.

   CButton *btn=new CButton();
   btn->Attach(hWnd);
   BOOL bs=btn->SendMessage(BN_CLICKED,0,0);
   if (bs)  TRACE("send ok");

   BOOL bp=btn->PostMessage(BN_CLICKED,0,0);
   if (bp)  TRACE("post ok");

post message is ok ,sendmessage is failed. I know the reason is the
creation of the button is not finished. now I want to add waiting time
when post message to the creating button .

My question is how to set additional message ( wParam and  lParam ) in
PostMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );

0
4/28/2006 4:44:27 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
621 Views

Similar Articles

[PageSpeed] 11

victorzou wrote:
> Hi,All
>       I get the button Hwnd which is being created via hook. I want to
> send message to this button.
> 
>    CButton *btn=new CButton();
>    btn->Attach(hWnd);
>    BOOL bs=btn->SendMessage(BN_CLICKED,0,0);
>    if (bs)  TRACE("send ok");
> 
>    BOOL bp=btn->PostMessage(BN_CLICKED,0,0);
>    if (bp)  TRACE("post ok");
> 
> post message is ok ,sendmessage is failed. I know the reason is the
> creation of the button is not finished. now I want to add waiting time
> when post message to the creating button .
> 
> My question is how to set additional message ( wParam and  lParam ) in
> PostMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );
> 

victorzou:

I'm not sure what you are trying to do here. Buttons send the BN_CLICKED 
notification to the parent, not the other way around. Also, BN_CLICKED 
is sent via the WM_COMMAND message. The BN_CLICKED is nominally the 
HIWORD of wParam, but its value is actually zero.

Your sendMessage fails because zero is not a valid Windows message.

What are you actually tring to do?

David Wilkinson
0
no-reply8010 (1790)
4/28/2006 9:36:52 AM
Reply:

Similar Artilces:

counting email messages being sent out
I am new to exchange 2003 administration. Is there a tool within MS Exchange 2003 that can bring up a count of how many emails were sent out for a particular time frame? Or is there a utility to download that can be used? Performance Monitor has lots of exchange counters. Try there. Vince -- Vince "Rob" wrote: > I am new to exchange 2003 administration. Is there a tool within MS Exchange > 2003 that can bring up a count of how many emails were sent out for a > particular time frame? Or is there a utility to download that can be used? Vince, Thanks for the heads up...

item stock inquiry error message
when I try to do an item stock inquiry, the following message pops up "An open operation on table 'tcsSYSTB00000_WindowsParams' failed accessing SQL data." when I clink to show more info, this is shown "[Microsoft][SQL Native Client][SQL Server]CREATE TABLE permission denied in database 'DAI'." Any idea how to fix this issue? Thanks - That sounds like a Trinity Computer Services table - have you asked them about this? -- Victoria Yudin Dynamics GP MVP Want to use Crystal Reports with GP? http://www.flex-solutions.com/gpreports.html blog: http://ww...

Right click to create new file with Excel 97
We use Excel 97 at our office on Windows XP Professional. A couple of users want to be able to create new files by using new from the right click menu and selecting Microsoft Excel Worksheet. The creation of the file works fine in that the filename is filename.xls. When they open the file and add information and then try to save the file, Excel wants to save as tab delimited. Creating a file by opening Excel first works just fine. We have tried this on several computers and the results are the same. For convenience is there some way to change this behavior? ...

Posting old bills
I am setting up Money 2006 to tract income and expenses for a rental property, but I need to back date it to 1/1/2007. How do I enter bills and deposits made in the past? Thanks Go to the account register and enter the manually. Just click on the next blank transaction and go to town. You may want to make sure you are using Advanced Register. If there are subsequent transactions already in these accounts and you have balanced the accounts to statements--as though these transactions were already entered--then you will have to adjust account beginning balances and/or Account Adjustment...

* OWA... (Third Post)
Microsoft? If you're concerned about security then you should respond to this question. We cannot make this OWA server available on the Internet without applying the latest SP and critical updates. =========================== Our OWA Exchange 5.5 server (Windows NT Server) recently died and we replaced it with a Windows 2000 Server. We installed Exchange 5.5 OWA then applied Exchange SP4. Everything was working until we apply Windows 2000 SP4. Everytime we logon we get "OWA was unable to get to your inbox" error. As soon as we un-installed Windows 2000 SP4, OWA wo...

To the sender of the MI5 posts
I am not sure if you read responses or (like most other spammers) just see the web as a place where you are free to say whatever you want without fear of contradiction. Who knows? Either way - this section of this site is site is specifically here so that anyone with a comment, question, point to rise, etc regarding access databases can post with the knowledge that other likeminded people may read their post. It is not here as a general forum to discuss other matters. I have no doubt that if you are blocked from posting you will see this as yet another indication that MI5 is after yo...

How do you create a pull down menu
I'm trying to create a pull down list for a column of cells that you can only select one of three names from this pull down menu. Thanks in Advance Ted 3M You can use Data>Validation. There are instructions in Excel's help files, and here: http://www.contextures.com/xlDataVal01.html Ted Jillett wrote: > I'm trying to create a pull down list for a column of > cells that you can only select one of three names from > this pull down menu. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...

OL07 keyboard "short"cuts in the Message Window?
In OL03, I was able to change the account to send a message with Alt+N followed by the number. Now, it seems, the shortcut is Alt+H,Y,1 followed by the number. Similarly, to send a message, I would use Alt+S. Now I have the choice of Alt+H,S or Alt+F,E. (Or Ctl-ENTER, I suppose.) Is there anything I can do to make OL07 use shorter shortcuts? Alt+S should still work... -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook ...

How do I create very small graphics in ONE cell?
I have data like following and I want to creat a line or 3 bars to reflect the numbers in ONE cell so that people can quicky scan through the trend. 3,225 2,356 1,087 I tried wizard but it doesn't look good when you minimize it. I tried autoshape but couldn't let the ahotopshap connect to the numbers. My boss said he has seen people do this before. Does anyone know how to do it? Thanks! There's a couple of ways to go. The first is to adapt the idea behind Using Worksheet Cells to simulate a graph http://www.tushar- mehta.com/excel/newsgroups/worksheet_as_chart...

Print Quote Button
We would like our sales people to be able to click the Print button on the Quote screen and have a quotation printed in our quotation format with logo et al. Does anyone know where to go to override the output of the quote button? Is the report developed in Crystal? Has anyone successfully tried to do this? I am also being request to do it for the Sales Order and Invoice forms once I figure out how to do a quote. Regards, GeorgeV You will need to look into the SDK for this. No, it is not using Crystal. Frank Lee Workopia, Inc. >> Other Microsoft CRM Online Forum Resources: ...

Outlook Message Inline Text
I have Outlook 2002 and need to know if I can change my received message format to inline text. Right now I have e-mails that have been forwarded multiple times as attachments instead of inline text but I can't synchronize it with my Pocket PC because of this. Any Suggestions? Thanks, Benny ...

What's the difference between Cross-posting and Multi-posting
And thanks for the discussion earlier... although the rudeness was unneeded. Sign me, A New User (and learning from you all) rochgal, you wrote on Thu, 22 Sep 2005 14:53:03 -0700: > What's the difference between Cross-posting and Multi-posting Cross-posting = You send one posting to several newsgroups. Multi-posting = You send several postings (with the same content) to several newsgroups. -- Best Regards Christian Goeller Some misspellings, grammatical or linguistical mistakes found? All corrections would be appreciated! ...

Post to GL
Hello I am having a problem with a setting within Great Plains 8.0 service pack 2. I have posting setup to only allow posting from the batch level for Inventory. But when you go into Inventory Batches the check box for post to gl is not marked. If I have it setup in posting to post to the gl shouldn't this check box be marked in inventory batches? -- Thanks, Brian Apples and oranges. The post to GL checkbox on the inventory batch window tells the system whether an IV transaction will post at all. The posting settings in tools --> setup --> posting tell the system w...

Intrastat posting issue
We are a UK company using intrastat. At the moment we cannot post invoices directly (thru) to the General ledger because we are getting an error saying that the 'intratsat information is missing'. When we click on an invoice that won't post in the Sales Transaction Entry screen, and click on the blue EC flag box, all the intrastat data is there and correct. Then when we post it goes through to the GL correctly. It seems that it will only post to the GL if every single line is checked (via the Blue EC flag) on the sales invoice regardless of the fact that all the date is alr...

Access 2002 bug: "dynamic" forms problem
There was no respond to my original post in microsoft.public.access.forms (May 5th 2007) about a fortnight so I try it here... ��������������������������������� A while ago we had a discussion about A2002 (sub)form which changes dynamically from code (hide/unhide controls, change subfom's width, etc.). There's a problem if I make some changes in code when the form is open: if I save changes, A2002 saves controls positions & subform's size as well. This is a BIG A2002 BUG and it's really annoying. Why Access forms don't behave as Visual Basic forms? I don't want Acc...

where is my post??
twice now I have typed up my post & sent it. So where is it? On Wed, 18 Jul 2007 08:41:36 -0700, Stapes <steve.staple@gmail.com> wrote: >twice now I have typed up my post & sent it. So where is it? On Google Groups: 1184773041.958329.270430@e16g2000pri.googlegroups.com Google's been having some problems lately, maybe it's temporarily unavailable. John W. Vinson [MVP] You mean the multiple posts with subject "Cancel = true"? I see 3 of them, and Allen Browne's already provided an answer. -- Doug Steele, Microsoft Access MVP http://I...

Is there a way I can only print the reply instead of the entire email message
I wonder if there is a way I can only print the reply to an email message, instead of printing the entire message? My choice for selection only seem to be gone with Outlook 2003 printing options. Any help is appreciated.............Peter ...

I want to use publisher to create a cover for a CD case
-- Rod the video guy I want to have a picture on the front and back and text info on the spine. Can this program do this and if so, which template or how do I do it? In the Wizard under labels is a good place to start. -- Don Vancouver, USA "Rod" <Rod@discussions.microsoft.com> wrote in message news:C3B83AD9-B181-46B6-AD80-98724B311061@microsoft.com... > > -- > Rod the video guy > I want to have a picture on the front and back and text info on the spine. > Can this program do this and if so, which template or how do I do it? Templates here http://ww...

Duplicate messages when filtering
I have created a rule to MOVE messages from one address to a subfolder, but every time these messages arrive, Outlook puts a copy of the message on the Inbox AND ALSO on the subfolder I specified on the rule. I checked the rule and the action ONLY says to MOVE the e-mail to the specified subfolder, not to leave a copy on the mais Inbox folder. I'm very annoyed by this, because I always have to go to the Inbox and delete the message copy. Any ideas? ...

My post not posted!
A couple of times when I've posted a reply to a recent post (same day), and later tried to view it, I found the header with a line drawn through it, and the following in the message body view pane: Message is no longer available on the server Windows Live Mail is unable to retrieve the requested message because the server no longer has the message available. -------------------------------------------------------------------------------- News servers regularly expire articles as they get older to make space available for newer articles. IMAP servers can be accessed by multip...

Sending message 1 of ....
In general, sending is fine but I get a "Sending message 1 of X" message in the status bar which does not correspond to anything. It started with "Sending Message 1 out of 2" a few months ago. It has recently grew up to 11. The only message I get is "503 bad sequence of command". All my fellow workers, connecting to the same server with the same Outlook 2003 version do not have this issue Any idea ? ...

Can't view Messages
I cannot view any newsgroup messages in the preview pane. The only way i can view it is to "reply" then i see the message below my reply. I have Win XP Pro, and Outlook 2003. Any help is appreciated. (My outlook / email works fine). -Matt nutshell222@hotmail.com Hi Matt, please use Outlook Express as Newsreader -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etwas davon hat. Bravestar@Datenschutzministerium.de "Matt" <nutshell222@hotmail.com> schrieb im Newsbeitrag news:ZqadneKI2qQ5RZvcRVn-uw@warpdrive.net... > ...

Cannot send newsgroup post with an attachment
I can send and receive posts using Outlook Express 6 newsgroups. I do not use html. When I send a post that has an attachment, e.g. a 160kB jpg that post never shows up as having been sent. How can I fix this? regards, "nobody" I can't speak for others, but msnews has a 100KB limit. If I have a need to post a graphic, I upload it to TinyPic and post the link to it. TinyPic: http://tinypic.com/ -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "news.microsoft.com" <nobody@nowhere.com> wrote in message ...

Fixed Assets Error Message
I've just installed GP10 SP 1 945412 on a test server. Originally I only installed SmartList builder. I've just finished adding Fixed Assets, Analytical Accounting (and Grant Management) and Project Accounting. When I launch GP Utilities I get the following error message: Fixed Assets Product 309 does not support upgrading from version 6.0.0 or prior Does anyone know what this means? Thanks! Maatthias, If you run the following query against your DYNAMICS database, what is the result? select db_name, db_verMajor, db_verMinor, db_verBuild from DB_Upgrade wher PRODID = 309 B...

Restricting activation of a form button
I'm using 2 form buttons which runs 2 different subs. The buttons are on the same sheet. I wish to restrict the activation of one of the 2 buttons (assigned to the sub below) to only authorised persons via say, a password prompt? which appears upon clicking the button. Grateful for an example or two of how this control could be done. Thanks Sub TestReset() Sheet8.Select Range("D10").Value = Range("G15").Value Range("D11").Value = Range("D15").Value End Sub I would try something like this: Sub TestRest() Sheet8.Select Dim...