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 ;}