:eek: could someone do me a favor and write -and then post it here- the (MASM) code for a program which, when executed, refreshes the Windows Desktop (in particular active desktop elements need refreshing)?
thanks!
thanks!
push 0FFFFh ; TRUE
push 0 ; whole region
push 0 ; desktop handle
call [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4c32.asp]InvalidateRgn[/url]
push 0 ; desktop handle
call [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_4zef.asp]UpdateWindow[/url]
MASM32
.386
.model flat,stdcall
option casempa: none
include windows.inc
include kernel32.inc
include user32.inc
includelib kernel32.lib
includelib user32.lib
.code
start:
invoke InvalidateRgn, NULL, NULL, TRUE
invoke UpdateWindow, NULL
xor eax,eax
invoke ExitProcess, eax
end start
thanks, only problem: it doesn't refresh the desktop-- neither with ActiveDesktop disabled or enabled
(and it's casemap for anyone else)
I'd need the F5 (update) command for the desktop - only thing: I don't know enough about Win32asm in order to know how to achieve that.
(the ActiveDesktop->UpdateNow command doesn't work)
(and it's casemap for anyone else)
I'd need the F5 (update) command for the desktop - only thing: I don't know enough about Win32asm in order to know how to achieve that.
(the ActiveDesktop->UpdateNow command doesn't work)
Try using the handle returned by GetDesktopHandle, instead of 0.
and how do i do that?
The GetDesktopWindow function returns the handle of the Windows desktop window.
The desktop window covers the entire screen. The desktop window is the area on top
of which all icons and other windows are painted.
HWND GetDesktopWindow(VOID)
Parameters
This function has no parameters.
Return Values
The return value is the handle of the desktop window.
Use the above function
to retrieve a DWORD value that you will PUSH instead of the 0 in the PUSH immediately
above the two function calls that Hiroshimator showed you on the first code.
In plain Japanese:
push 0FFFFh ; TRUE
push 0 ; whole region
push 0 ; desktop handle
call InvalidateRgn
push 0 ; desktop handle
call UpdateWindow
turns into:
call GetDesktopWindow
mov ebx,eax ; save handle
push 0FFFFh ; TRUE
push 0 ; whole region
push eax ; desktop handle
call InvalidateRgn
push ebx ; desktop handle
call UpdateWindow
or a perhaps more elegant:
call GetDesktopWindow
push eax ; save handle
push 0FFFFh ; TRUE
push 0 ; whole region
push eax ; desktop handle
call InvalidateRgn
call UpdateWindow
Here we come back to my "use our search engine" complain...
http://www.asmcommunity.net/board/index.php?topic=5039&highlight=refresh+desktop
http://www.asmcommunity.net/board/index.php?topic=5039&highlight=refresh+desktop
sorry Maverick, but it still doesn't work;
and I really don't know much about Win32 programming either: Has the problem been solved in that other post?
doesn't seem so?
it might just be the same command (with an appropriate parameter) as the command used to update explorer after file operations, as WinZip for example does after creating a Zip file.
any other help?
thanks all
and I really don't know much about Win32 programming either: Has the problem been solved in that other post?
doesn't seem so?
it might just be the same command (with an appropriate parameter) as the command used to update explorer after file operations, as WinZip for example does after creating a Zip file.
any other help?
thanks all
and I really don't know much about Win32 programming either: Has the problem been solved in that other post?
Yes.
SHChangeNotify is the same what Windows sends when you hit F5 when your desktop got the focus.
so SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_IDLIST, lpil, 0) will do it?
could you put that in MASM code for me ...?
thanks in advance
could you put that in MASM code for me ...?
thanks in advance
if he uses active desktop would trhat be another layer? I remeber that you could have a background on the real desktop and a background on the active one. maybe that's what happens here?
<CTRL+D>
bpx SHChangeNotify
<CTRL+D>
*click on desktop*
<F5>
Didn't break!
aweX <-
bpx SHChangeNotify
<CTRL+D>
*click on desktop*
<F5>
Didn't break!
aweX <-
<CTRL+D>
bpx SHChangeNotify
<CTRL+D>
*click on desktop*
<F5>
Didn't break!
aweX <-
Yeah, I didnt remember correct about a system I didnt touch for ages ;)
:stupid:
I don't really know what to make of that, so...
could you write that as a complete MASM program for me?
like
.586
.model flat,stdcall
option casemap: none
include C:\masm32\include\Windows.inc ;which are needed?
include C:\masm32\include\kernel32.inc
include C:\masm32\include\user32.inc
includelib C:\masm32\lib\kernel32.lib
includelib C:\masm32\lib\user32.lib
.code
start:
call SHChangeNotify ;how to do?
xor eax,eax
invoke ExitProcess, eax
end start
I don't really know what to make of that, so...
could you write that as a complete MASM program for me?
like
.586
.model flat,stdcall
option casemap: none
include C:\masm32\include\Windows.inc ;which are needed?
include C:\masm32\include\kernel32.inc
include C:\masm32\include\user32.inc
includelib C:\masm32\lib\kernel32.lib
includelib C:\masm32\lib\user32.lib
.code
start:
call SHChangeNotify ;how to do?
xor eax,eax
invoke ExitProcess, eax
end start
AnotherForumAnotherName,
Get the drift of this, this forum is not a code ordering facility and you tread on dangerous grounds treating it like that.
If you have a technical question, ask it but spare us the idea that someone should be writing your code for you. Try "rent a coder" if you have that mentality, keep it up here and you will receive the appropriate motivation to ask elsewhere.
Then you can change your nick to AnotherForumAnotherNameAgain.
Regards,
hutch@movsd.com
Get the drift of this, this forum is not a code ordering facility and you tread on dangerous grounds treating it like that.
If you have a technical question, ask it but spare us the idea that someone should be writing your code for you. Try "rent a coder" if you have that mentality, keep it up here and you will receive the appropriate motivation to ask elsewhere.
Then you can change your nick to AnotherForumAnotherNameAgain.
Regards,
hutch@movsd.com
ah yes,
I thought if s.o. knows the answer, it might be a 1 liner (or 3 or 4)
regarding the function call reference: msdn yielded "0 results" when searching for these function names; can you recommend any place to look them up (I suspect I'll be able to make out their call syntax in MASm myself (partly I know, I currently just dont know how to "use" the constants in that function arguments)
I thought if s.o. knows the answer, it might be a 1 liner (or 3 or 4)
regarding the function call reference: msdn yielded "0 results" when searching for these function names; can you recommend any place to look them up (I suspect I'll be able to make out their call syntax in MASm myself (partly I know, I currently just dont know how to "use" the constants in that function arguments)
Afternoon, LazyCoder.
Get the Platform SDK from Microsoft. It's far better to use that than searching MSDN over the Net.
If you want to learn how to use the Win32 API with assembly then go through the examples which are included within the Masm32 package and Iczelions' tutorials.
Cheers,
Scronty
Get the Platform SDK from Microsoft. It's far better to use that than searching MSDN over the Net.
If you want to learn how to use the Win32 API with assembly then go through the examples which are included within the Masm32 package and Iczelions' tutorials.
Cheers,
Scronty
:eek: :rolleyes: :tongue: :) :o
thaanky
thaanky
Weird... it won't even work like this:
SendMessage(GetDesktopHandle(), WM_KEYDOWN, VK_F5, MapVirtualKey(VK_F5, 0) << 16);
SendMessage(GetDesktopHandle(), WM_KEYDOWN, VK_F5, MapVirtualKey(VK_F5, 0) << 16);
aweX, send a WM_KEYUP, too and it should work. (I guess :))
Has anyone tried:
Has anyone tried:
invoke SendMessage, 0, WM_COMMAND, WM_REFRESH_DESKTOP, 0
...(edit) doesn't appear to do anything on WinXP.