473,796 Members | 2,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

parent windows from DLL

I need to send refresh message to Windows Explorer from shell
extension(DLL).
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.

Thanks, Rajko


Nov 17 '05 #1
8 1876
>I need to send refresh message to Windows Explorer from shell
extension(DLL) .
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.


Rajko,

What are you doing that requires refreshing Explorer?

Have a look at SHChangeNotify I suspect that's most likely what you
need.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(

Rajko

"David Lowndes" <da****@example .invalid> wrote in message
news:kc******** *************** *********@4ax.c om...
I need to send refresh message to Windows Explorer from shell
extension(DLL) .
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.


Rajko,

What are you doing that requires refreshing Explorer?

Have a look at SHChangeNotify I suspect that's most likely what you
need.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #3
>I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #4
This is interesting.
First I tried SHChangeNotify( SHCNE_RENAMEITE M, SHCNF_PATH, OldFileName,
NULL);
well... items renamed just dissapeared .... (on F5 they reaper renamed)
Then I found solution thx to Dave :
SHChangeNotify( SHCNE_RENAMEITE M, SHCNF_PATH, OldFileName, NewFileName);

BTW I was convinced that I need to use PostMessage() and got stuck with it.

Thanks, Dave.
"David Lowndes" <da****@example .invalid> wrote in message
news:3s******** *************** *********@4ax.c om...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #5
I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!

Rajko.
"David Lowndes" <da****@example .invalid> wrote in message
news:3s******** *************** *********@4ax.c om...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #6
It could be fixed with SHCNF_FLUSH flag but it slowes down process much.
Flag SHCNF_FLUSHNOWA IT does not work since it is closed loop and message
loop can not process sent messages.

Rajko.

"Rajko" <ra***@fly.srk. fer.hr> wrote in message
news:c6******** **@bagan.srce.h r...
I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!

Rajko.
"David Lowndes" <da****@example .invalid> wrote in message
news:3s******** *************** *********@4ax.c om...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or betterWindows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq


Nov 17 '05 #7
>I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!


Doesn't the whole folder get updated - eventually?

Here's a quote from an old post on the subject by Raymond Chen [MS]
about the multiple notifications issue:

"If you send a lot of file update notifications, they get combined
into a single "directory update" notification, and Explorer refreshes
the entire directory - so the operation still succeeds; the items you
sent notifications on did get updated. (as did a bunch of files that
you didn't send notifications on, but no harm done there)
"

.... so if this isn't happening, it's presumably a bug/quirk in the
shell. Which OS versions have you tested with? Are all OS's behaving
the same?

Dave
Nov 17 '05 #8
Well, I Win XP pro v2002 SP1 and all updates available from SP2 on windows
update site.
Got .NET framework 1.1.
I tested od dir C:\Tmp\Test 100 and I heve there files:
copy (10) of empty.txt
copy (11) of empty.txt
copy (12) of empty.txt
copy (13) of empty.txt
copy (14) of empty.txt
copy (15) of empty.txt
copy (16) of empty.txt
copy (17) of empty.txt
copy (18) of empty.txt
copy (19) of empty.txt
copy (20) of empty.txt
copy (21) of empty.txt
_cczsd.asd
_cczsd.qwe

the last two have Croatian letters for test purpose.
If I update first 5 copy... they are updated, but when I try first 6
nothing.
I use flag SHCNF_FLUSHNOWA IT in every call and only every 5th SHCNF_FLUSH
which wait for shell to process messages. That is only way it works.
I tryed renaming 400 files "copy of..." and they were only 400 in that dir
just with SHCNF_FLUSHNOWA IT and nothing happened after renaming to UPPERCASE
letters. When I pushed F5 it was all there, renamed.

Rajko.
PS I will test it on few other machines and then post message here.
----- Original Message -----
From: "David Lowndes" <da****@example .invalid>
Newsgroups: microsoft.publi c.dotnet.langua ges.vc
Sent: Friday, April 23, 2004 4:16 PM
Subject: Re: parent windows from DLL

I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!


Doesn't the whole folder get updated - eventually?

Here's a quote from an old post on the subject by Raymond Chen [MS]
about the multiple notifications issue:

"If you send a lot of file update notifications, they get combined
into a single "directory update" notification, and Explorer refreshes
the entire directory - so the operation still succeeds; the items you
sent notifications on did get updated. (as did a bunch of files that
you didn't send notifications on, but no harm done there)
"

... so if this isn't happening, it's presumably a bug/quirk in the
shell. Which OS versions have you tested with? Are all OS's behaving
the same?

Dave

Nov 17 '05 #9

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

Similar topics

5
27603
by: Paul | last post by:
Hi all, Here is what I am trying to do. I have a parent class calling a child class. when one function in child class is called, i need to call parent class' function. How can I get parent class' pointer? Thx Paul
3
11880
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a to-be-developed-function cmdOkay_Click() function as described below. 1. Create an user control that contains an OK button as below Public Class MyButton:System.Windows.Form.UserControl
6
6226
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the method from the mdichild, I get this error: C:\MyProjects\Visual Studio Projects\Tournament\Forms\frmLogin.cs(69): The name 'test' does not exist in the class or namespace 'Tournament.frmLogin' frmLogin is the mdichild.
1
2260
by: Tomas Vera | last post by:
Hello All, I'm working on a web app that will simulate a Windows app. One of the items that I've trouble reproducing is the parent/child interaction that might occur between a windo and popup custom dialog box (example: right click an item and bring up a Config/Properties dialog of the selected item). In a Windows app, I can add a handler in the Parent to respond to the "OK" event in the child window so that I can update the object's
3
9707
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI parent menu functions. if i select draw line in MDI parent, the line should be drawn in current active child..any URLS for this or guide me to achieve this communication... -- Mähésh Kumär. R
3
2696
by: Eddie | last post by:
If FormMain = MDI parent, FormSub = Child parent, I execute FormSub from the menu like this way. FormSub^ sub = gcnew FormSub; sub->MdiParent = this; sub->Show(); This can generate child form sub in FormMain. In th FormMain, there is status bar label named statusBar; I'd like to add code in the sub form that can access statusBar of parent
2
2760
by: epaetz | last post by:
Is there a way to decouple the linkage between a parent and a child window? Does the parent window have any sort of a collection that holds all the children that it has spawned? I want to break that connection from the parent side or the child side, it doesn't matter as long as the communication link is completely broken. I don't want the parent to be aware of the child and vice-versa.
3
18720
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
6
2518
by: SQACSharp | last post by:
I'm using the EnumChildWindows API with an EnumChildWndProc callback to populate the treeview. The output will be something similar to spy+ + How can I specify the parent when adding a new node ?? When adding a new node is there any way to get an handle or something else to be able add the childs to the correct parent ? Thanks!
1
2432
by: Bhishm | last post by:
Hi, I have a window (192.168.1.223/test.ph) in which one iframe continuously runs. I open another window from that window (192.168.1.223/test1.php) which also runs an iframe continuously. Now the problem is that only one runs at a time the othere window just hangs. If I control the child from parent than after refreshing the parent
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.