Thread: GetGUIThreadInfo()

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    104

    GetGUIThreadInfo()

    Hello,

    In my application I am making a call to GetGUIThreadInfo() but it returns 0. After making a call to GetLastError() I see that it's returning 87; which hints to the fact that I am passing an incorrect parameter. Here is how I invoke it:
    Code:
        GUITHREADINFO info;
        char buff[256];
        info.cbSize = sizeof(GUITHREADINFO);
    
        GetGUIThreadInfo(GetCurrentThreadId(), &info);
        GetWindowText(info.hwndActive, buff, 256);
        printf("Current Window: %s\n", buff);
    The MSDN documentation indicates that the only thing required in order to let a call to GetGUIThreadInfo() function properly is setting the GUITHREADINFO's cbSize member to sizeof(GUITHREADINFO), which I am doing.

    What can be wrong?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> What can be wrong?

    It worked fine on my system.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    104
    On mine it doesn't

    I am running Windows XP
    Last edited by abraham2119; 07-31-2009 at 01:25 AM.

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >>On mine it doesn't

    Well, MSDN does say to use GetWindowThreadProcessId or NULL (to get the current process info), although I can't imagine why GetCurrentThreadId wouldn't work.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. using GetGUIThreadInfo
    By meb4u in forum Windows Programming
    Replies: 6
    Last Post: 11-13-2002, 02:31 PM