473,396 Members | 1,992 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.

GetOpenFileName API Hooks

SammyB
807 Expert 512MB
I am trying to get back to the way Office 97 allowed multiselect in GetOpenFileName: the order you selected was the order returned. This means that I must keep my own list of files which changes whenever the user changes the selection. I started with Dev Ashish's code for the GetOpenFilename API, http://www.mvps.org/access/api/api0056.htm. In the hook proc whenever I get a CDN_SELCHANGE notification, I send a CDM_GETSPEC msg to the parent to get the current list of files. The first one in the list seems to be the most recently selected, so I can construct an ordered list as long as the
user ctrl-clicks.

The problem is when the user shift-clicks. In order to construct a list, I need to get the complete list of files for the current directory which is in the listbox and also get it in the order that it is in the listbox. I have tried to send the listbox a WM_GETTEXT message, but I do not get a response: probably I have the wrong hWnd. I am getting the hWnd with
Expand|Select|Wrap|Line Numbers
  1. hWndList = FindWindowEx(hWndParent, 0, "SHELLDLL_DefView", vbNullChar)
  2.  
How should I get the handle and/or the list?

Note, I get the directory name whenever the user changes it via the CDN_FOLDERCHANGE notification and the CDM_GETFOLDERPATH msg, but I cannot just use dir to get the file list, because it may be in the wrong order. I have to get it from the dialog's listbox.

TIA --Sam
Oct 8 '07 #1
0 1195

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: paul francis | last post by:
Hi Please help because I'm really stuck: I'm trying to write an application in C# which can be used to track the mouse pointer position on any window. I'm trying to use a Global mouse hook to...
5
by: Jim Hubbard | last post by:
I don't think you can hook system events outside your application in .Net without using an unmanaged DLL, but I thought I'd ask. Jim Hubbard
0
by: yaktipper | last post by:
WH_JOURNALPLAYBACK and WH_JOURNALRECORD These hooks are difficult to get working in C#, but after much piecing together of various code snippets from different language examples across the Net,...
0
by: SS | last post by:
I tried a sample code provided in Microsoft .NET on how to make a call to Win32 GetOpenFileName. It crashed if I call the function, select a file and close the dialog and repeat the process several...
14
by: Rajko | last post by:
GetOpenFileName with flag OFN_ALLOWMULTISELECT will create error message if number of characters exceeds 29700 characters. I does not matter if you alocated enough space. It will use only first...
1
by: mnlarsen | last post by:
How do I set the default location to "My Computer" when using the GetOpenFileName call? I have tried the following but CSIDL_DRIVES doesn't appear to work. Any ideas? WCHAR szFile =...
3
by: cichy83 | last post by:
Hi! I have a problem with global hooks under these two OS. I'm using three following types of hooks: CBT Hokk, Keyboard Hook, Mouse Hooks. I'm using BCB 6, under Win XP everything works fine...
0
by: riva91 | last post by:
I am migrating an application from excel to access. In excel I used the build in GetOpenFilename function where you can give the parameter Multiselect:=True. In Access I use the GetOpenFilname...
2
by: qhimq | last post by:
Hi, I was wondering if anyone encountered the following error with GetOpenFileName(). The open dialog opens, and I hover my mouse over a file. The dialog shows the detailed info of the file...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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.