which of these is the handle to my windowless app?

This is a discussion on which of these is the handle to my windowless app? within the C++ Programming forums, part of the General Programming Boards category; http://img194.imageshack.us/img194/1737/hwnd8ry.jpg i am trying to post a message to my windowless app i tried Code: PostMessage( theApp.GetMainWnd()->m_hWnd , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    which of these is the handle to my windowless app?

    http://img194.imageshack.us/img194/1737/hwnd8ry.jpg


    i am trying to post a message to my windowless app

    i tried
    Code:
    PostMessage(  theApp.GetMainWnd()->m_hWnd , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    
    PostMessage(  theApp.m_hThread , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    
    PostMessage( hwnd , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    
    PostMessage(  m_pMainWnd->GetSafeHwnd() , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    
    PostMessage(  GetParent(0) , WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    	
    PostMessage(this->m_pMainWnd->m_hWnd, WM_MAKE_TIME_STOP_DLG, (WPARAM)broken_msg_obj.parm2, 0);
    but they all either give compile error or dont work


    my initinstance of the app
    Code:
    BOOL CAsevApp::InitInstance()
    {
    	// Standard initialization
    	// If you are not using these features and wish to reduce the size
    	//  of your final executable, you should remove from the following
    	//  the specific initialization routines you do not need.
    	CDialog dlg;
    	m_pMainWnd = &dlg;
                   return TRUE;
    }
    please asssist :wave:

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    if you wrote it you should know.. you came up with it's name
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    114
    because i am a newbie at programming, i have problems identifying what i created
    so i need some help

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    You also seem to have a problem identifying which board to post your windows specific questions on, too.

    >>but they all either give compile error or dont work<<

    Help us to help you: provide explicit details about these errors or in what way 'it doesn't work'.

    If you intend to use mfc then use it - in an mfc application you typically only need to use winapi functions where mfc doesn't provide an alternative method so use CWnd::PostMessage instead of ::PostMessage. Either way, you still need to have a valid window to work with which you won't until you create either a modeless dialog (CDialog::Create ) or a modal dialog ( CDialog::DoModal ). If your dialog is modal then you'll only be able to access its window handle from within its class; when the function returns the dialog is gone and m_pMainWnd becomes effectively useless.

    >>a newbie at programming<<

    There should be lots of mfc examples with your compiler - the web is full of mfc code or, if you prefer a textbook, Jeff Prosise's Programming Windows with MFC is a good introduction.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting other processes class names
    By Hawkin in forum Windows Programming
    Replies: 3
    Last Post: 03-20-2008, 04:02 PM
  2. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  3. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  4. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 05:56 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21