Results 1 to 5 of 5

Thread: move popup window

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    move popup window

    hey im trying to move a window with a popup style. can some one please tell me if the code im using is along the right lines.

    [ccode]
    case WM_COMMAND:
    {
    switch(LOWORD(wParam))
    {
    case WM_MOUSEMOVE:
    {
    ReleaseCapture();
    int y(GET_Y_LPARAM(lParam));
    int x(GET_X_LPARAM(lParam));
    SetWindowPos(hwnd,HWND_TOPMOST,x,y,NULL,NULL,SWP_NOSIZE);
    break;
    }
    break;
    }
    [ccode]

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Why the ReleaseCapture()?
    Other than that it looks ok.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    i keep getting these errors any idea whats wrong?

    c:\C++\wUnTitled\wUnTitled.cpp(17): error C3861: 'GET_X_LPARAM': identifier not found, even with argument-dependent lookup
    c:\C++\wUnTitled\wUnTitled.cpp(16): error C3861: 'GET_Y_LPARAM': identifier not found, even with argument-dependent lookup
    Cheers

  4. #4

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    okay ive only got this code for it now it seems to work, but it exits straight afterwards.

    Code:
    SendMessage(hwnd,VK_RSHIFT,2,0);
    Cheers

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    VK_RSHIFT is not a message. You need to send a WM_KEYDOWN/WM_KEYUP pair and do correct encoding for wParam and lParam.

    To solve the errors you must include <windowsx.h>
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width