×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How do I get back "handle of" created control via CreateWindowEx ?

How do I get back "handle of" created control via CreateWindowEx ?

How do I get back "handle of" created control via CreateWindowEx ?

(OP)
Greetings;
I am looking for a way to createWindowEx and to get the handle of the control just created. I do exactly what the specs say, but all I get back is a return code.
I have tried both these ways:
callfunc CreateWindowExA,
hwnd = CreateWindowExA(
but all i get back is a "0", telling me that all is well.
Pls, how can i do this.
Code in C+ or VB or HotBasic would be great!
Thanks...vmars

RE: How do I get back "handle of" created control via CreateWindowEx ?

>all i get back is a "0", telling me that all is well.

Er, actually not. 0 means it failed.
 

 

RE: How do I get back "handle of" created control via CreateWindowEx ?

It's a Win32 FAQ
see on professional Win32 group
http://tinyurl.com/yjy3ajr  

RE: How do I get back "handle of" created control via CreateWindowEx ?

Sorry, but strongm is right...

Quote:


Return Value


If the function succeeds, the return value is a handle to the new window.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

This function typically fails for one of the following reasons:

an invalid parameter value
the system class was registered by a different module
The WH_CBT hook is installed and returns a failure code
if one of the controls in the dialog template is not registered, or its window window procedure fails WM_CREATE or WM_NCCREATE

http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx

A return value of null can equate to zero...



Good Luck

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close