Collecting uncommon windows APIs and small functions...

Source: Internet
Author: User

1. Determine whether the current OS is clicked or double-clicked by default.

 
Bool isdoubleclickinwebview () {shellflagstate SFS; zeromemory (& SFS, sizeof (shellflagstate); shgetsettings (& SFS, callback); Return SFs. fdoubleclickinwebview! = 0? True: false ;}

2. Get the window handle of the current desktop

Hwnd findshellwindow () {// sometimes, we can't find the desktop window when we use this function, but we must // find it's handle, so we do a loop to find it, but at most we find for 10 times. uint ufindcount = 0; hwnd hsyslistview32wnd = NULL; while (null = hsyslistview32wnd & ufindcount <10) {hwnd hparentwnd =: getshellwindow (); hwnd completion = :: find1_wex (hparentwnd, null, l" Shelldll_defview ", null); hsyslistview32wnd =: findjavaswex (partial, null, l" syslistview32 ", l" folderview "); If (null = hsyslistview32wnd) {hparentwnd = :: findshortwex (null, null, l "workerw", l ""); While ((! Signature) & hparentwnd) {Signature =: findincluwex (hparentwnd, null, l "shelldll_defview", null); hparentwnd = findincluwex (null, hparentwnd, l "workerw ", L "");} hsyslistview32wnd =: findjavaswex (hshelldll_defviewwnd, 0, l "syslistview32", l "folderview");} If (null = hsyslistview32wnd) {sleep (1000); ufindcount ++;} else {break ;}} return hsyslistview32wnd ;}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.