Results 1 to 4 of 4

Thread: FindWindow() function for windows example

  1. #1
    Join Date
    Mar 2013
    Beans
    10

    FindWindow() function for windows example

    Ok so I had to do a little fiddling around with this function and noticed almost no were on the internet is there a good example of working code.

    Code:
    #include <windows.h>
    #include <winuser.h>
    
    using namespace std;
    
    int main()
    {
    
        HWND hWnd = FindWindow(L"SciCalc",0);
    
        SetForegroundWindow(hWnd);
    
    }
    SciCalc is the classname of windows calculator. To find the class name of a window download WinSpy++. You will need to add L in front of any string you want to use in arguments.

  2. #2
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,264
    Distro
    Kubuntu

    Re: FindWindow() function for windows example

    Wow!

  3. #3
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,163
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: FindWindow() function for windows example

    Of course, posting this in a Linux forum gives it the visibility it merits with Windows developers

    Wow? (Why On Windows?)
    Warning: unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.

  4. #4
    Join Date
    Mar 2013
    Beans
    10

    Re: FindWindow() function for windows example

    just small program i was making for someone using qt in ubuntu. Just wanted to put it out there for anyone else to help give working code not the garbage of badly arranged code, and or overly long code you have to read through to find usefual information regarding this function.

Bookmarks

Posting Permissions

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