GetGUIThreadInfo()

This is a discussion on GetGUIThreadInfo() within the Windows Programming forums, part of the Platform Specific Boards category; Hello, In my application I am making a call to GetGUIThreadInfo() but it returns 0. After making a call to ...

  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
    Posts
    5,439
    >> What can be wrong?

    It worked fine on my system.
    Code:
    int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000
    <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan
    (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000
    )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 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
    Posts
    5,439
    >>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:
    int main(void){srand(time(0));for(double l=rand(),l0=0,l00=0;;l0+=0.1){for(double l000=0;l000
    <1;l000+=.001,l+=((double)rand()/RAND_MAX)/0x64,l00+=((sin(l*0x8*atan(l0)*l000-(l0*0x8*atan
    (l)))*0.5)+0.5)){l00-=floor(l00);for(size_t l0000=0,l00000=(size_t)(0x50*(l00));l0000<l00000;++l0000
    )putchar(0x20);putchar(0x61+(int)((double)rand()/RAND_MAX*0x1a));putchar('\n');}}return 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, 01:31 PM

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