Thread: Showing HWND

  1. #1
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640

    Showing HWND

    I'm having troubles trying to display the HWND of my window to an edit box. I'm thinking I should typecast it, but I don't know to what. It's in hex, right? Should I typecast it or what?
    Environment: OS X, GCC / G++
    Codes: Java, C#, C/C++
    AOL IM: neandrake, Email: neandrake (at) gmail (dot) com

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    UK
    Posts
    170
    Try converting the hWnd to a string then display the string in the edit box.

    HWND hWnd;
    char Temp[20];

    sprintf(Temp, "%x", hWnd);

    >display Temp....



    OR with leading 0's..... i.e 0009012E

    sprintf(Temp, "%08x", hWnd);
    Last edited by Scarlet7; 03-21-2003 at 05:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Avoiding Global variables
    By csonx_p in forum Windows Programming
    Replies: 32
    Last Post: 05-19-2008, 12:17 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. My first "real" windows app
    By JoshR in forum Windows Programming
    Replies: 2
    Last Post: 07-28-2005, 07:40 AM
  4. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 07:48 PM