473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refresh Desktop or fileexplorer

Hello

In my code I create a folder on the desktop or any other folder
location.

Unless I press F5 while the Desktop or the Explorer containing the
created folder has the focus this new folder will not show up.

Is there a solution to do a refresh programatically?

I tried

AppActivate("Desktop")
SendKeys.Send("{F5}")

The problem seems to get the right explorer.

Thank you for any help in advance.

Regards

Manfred
Sep 10 '07 #1
3 8339
Manfred,

' Declaration

Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As
Int32, ByVal uFlags As Int32, ByVal dwItem1 As Int32, ByVal dwItem2 As Int32) As
Int32

The line below is used to refresh the Desktop:

' Refresh
SHChangeNotify(&H8000000, &H0, 0, 0)

--
Newbie Coder
(It's just a name)

"Manfred Meier" <mm@nospam.comwrote in message
news:e8*************@TK2MSFTNGP06.phx.gbl...
Hello

In my code I create a folder on the desktop or any other folder
location.

Unless I press F5 while the Desktop or the Explorer containing the
created folder has the focus this new folder will not show up.

Is there a solution to do a refresh programatically?

I tried

AppActivate("Desktop")
SendKeys.Send("{F5}")

The problem seems to get the right explorer.

Thank you for any help in advance.

Regards

Manfred

Sep 10 '07 #2
Works great thank you a lot!

Regards

Manfred

Newbie Coder wrote:
' Declaration

Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As
Int32, ByVal uFlags As Int32, ByVal dwItem1 As Int32, ByVal dwItem2 As Int32) As
Int32

The line below is used to refresh the Desktop:

' Refresh
SHChangeNotify(&H8000000, &H0, 0, 0)

--
Sep 11 '07 #3
Manfred,

My Pleasure

--
Newbie Coder
(It's just a name)

"Manfred Meier" <mm@nospam.comwrote in message
news:OW**************@TK2MSFTNGP04.phx.gbl...
Works great thank you a lot!

Regards

Manfred

Newbie Coder wrote:
' Declaration

Private Declare Function SHChangeNotify Lib "Shell32.dll" (ByVal wEventID As
Int32, ByVal uFlags As Int32, ByVal dwItem1 As Int32, ByVal dwItem2 As
Int32) As
Int32

The line below is used to refresh the Desktop:

' Refresh
SHChangeNotify(&H8000000, &H0, 0, 0)

--

Sep 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kiplring | last post by:
I wrote a program which draw a dancer at cornor of desktop. ( I Accessed through hDC) But It has a problem. I remains all trait at the desktop until I invoke any Redraw( Refresh) action - click,...
2
by: Marion | last post by:
Is there a helping hand? I was able to get the DC of the desktop to draw on it, but now i need the functionality to refresh the desktop and delete the drawing i made. At this time i "solve" the...
0
by: Stephan Steiner | last post by:
Hi I'm experiencing a weird problem updating the desktop background. I'm using the code from http://www.devhood.com/messages/message_view-2.aspx?thread_id=70216 (at the bottom), which works...
1
by: muttu2244 | last post by:
Hi everybody I have couple of questions, 1) How can i refresh my desktop window(wallpaper), using the python script, after pasting some data on the desktop. 2) How can i run an exe file...
1
by: rodmc | last post by:
Hi, Does anyone know how I can create an Active Desktop window from within a Python script? It would also be good to know how to refresh that window and nothing else. At present I have an...
0
by: PiotrKolodziej | last post by:
Hi I have an application with treewiev and menu and so on... When i enter application and exit there isn't problem. If i enter , search in treewiev and exit, white rectangle ramains on my desktop....
1
by: Tee | last post by:
Hi, How do i refresh windows destop in c#? currently with my c# app, it deletes an existing desktop icon and recreates a new one base on the new informations the user provided. All seems to...
4
by: panks2007 | last post by:
Hi, When I close the File.exe the menubar remains on the desktop unless and untill i refresh the desktop in windows(XP,server2003). How should I refresh the windows desktop in VB6.0 using...
0
by: Desmodromic | last post by:
I have two linux servers running DB2 v8.2 with SQL replication. I recently started a full refresh of a single subscription set via the Replication Center GUI. This was successful, but seemed to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.