|
Trace the state in the dialog. In its WM_xxxFOCUS you will be notified which window actually receives the focus if it is not the tray some other app is activated.
This still leaves you with the problem when the user clicks on another trayicon first and then on your applications icon. Or clicks on the explorer bar and then on the app icon. Or does it by keyboard.
However, you should find a better design for your dialog solution.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Thanks Andreas,
However, you should find a better design for your dialog solution.
I thought a lot about it, but I don't think that a really nice design for this problem even exists. The dialog is deactivated if somebody clicks the icon and there is no chance to examine if it was activated before.
I now found a solution which is similar to what you suggested. I catch WM_ACTIVATE in the dialog and remember the current system time if the dialog is deactivated. In the tray icons handler I check the dialog was deactivated immediately before the handler was executed (less than 200 ms). If this is the case, it was deactivated because of clicking on the icon.
Not the cleanest design, but works fairly well - even on high system load.
Thanks!
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Hi,
I am currently trying to retieve the path to a CDwriter, I have the targetId of the scsi device and require the drive path. I have a solution for NT,2000 which uses the CreateFile function to obtain a handle to the disk device and then use this handle with DeviceIoControl function and a drive path to return a targetID thus correlating TargetIds to drivepaths.
Unfortunately this method does not work on 98 as the CreateFile function will is not supported for retrieving a handle to a disk volume on 98.
Does anybody know of a method to get a handle to the disk device on 98 or a completely different method which would produce a drive path from a targetId or TargetId from DrivePath.
Chris H
|
|
|
|
|
Chrish120 wrote:
Does anybody know of a method to get a handle to the disk device on 98 or a completely different method which would produce a drive path from a targetId or TargetId from DrivePath.
AFAIK you have to do it the ASPI way on Win9x. Sorry.
Btw, you do know you can do it "the other way around" even on NT-based OS'es? Grab the drive-letter and then use QueryDosDevices to find the device. Such code worked like a charm for me in the past for CDRecord (speaking of which, you might want to have a look at it since it already is a working CD recording solution).
++luck;
|
|
|
|
|
To anybody interested I found a solution on Windows 98 via the registry
reading currentdiveletterassignment key under the HKLM\Enum\Scsi\,
so coupling thhis with the CreateFile solution allowed me to match all to TargetIds to drive Paths on each of the windows OS.
Thanks for the help....
Chris
|
|
|
|
|
Hi All,
I Need to run a exe in my application which lies in the path other than the current application.To run such an application I need to specify the whole path of the exe which I wish to run.If the file exists in the location which has a space in the folder name such as "Program Files" then the exe won't run.For this if I can get the MSDOS name of the file I can run the exe.
Can anybody guide me how can I get the MSDOS name.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
I suppose with "MSDOS name" you mean FAT 8.3 notation, right?
You can get it by calling the GetShortPathName() API.
However, it is a not so good idea to solve your problem this way! Not every filesystem has necessary a 8.3 alternate notation. For NTFS volumes it is just a flag if they store alternate 8.3 names or not. Some network file systems may also not support this old crappy MS-DOS trash.
If your path contains spaces, just enclose it in quotation marks and everything should work fine.
Come on, boys, it's really the time to forget about this legacy 8.3 bullshit
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
I have successfully managed to split a window into two panes or views, but i'm lost as to how I can get a pane split in half again...?
I'm aware of the CSplitterWnd classes available here @ CP, but i'm interested in seeing how it's done and learning exactly whats going on....
Someone care to show me how I would get the following:
----------------
|1| 3 |
|-| |
|2| |
| | |
| | |
----------------
I know hwo to get 1 and 3, but NOT 2
heres my code so far:
m_wndSplitBar.CreateStatic(this, 1, 2);
m_wndSplitBar.CreateView(0, 0, RUNTIME_CLASS(CTaskView), CSize(100, 100), NULL);
m_wndSplitBar.CreateView(0, 1, RUNTIME_CLASS(CPlanView), CSize(100, 100), NULL);
m_wndSplitBar.SetColumnInfo(0, 146, 146);
How would I make the triple split like above from this...?
Thanx!
p.s-I'm trying to get one splitter to lock and the other to draw flat and those wrapper classes don't help much...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Anybody knows the IncrediBuild software for reduce compilation time ?? It's really good ??
[]'s
Cris.
|
|
|
|
|
Yes,
we are testing it - it really does help if you have many PC's idle on the network
Victor Rubinstein
|
|
|
|
|
I want to hide vertical scroll bar in CListCtrl derived class
I tried this code in PreCreateWindow:
DWORD dwStyle = cs.style;
if(dwStyle & WS_VSCROLL)
{
dwStyle &= ~WS_VSCROLL;
cs.style = dwStyle;
}
and this in OnSize:
DWORD dwStyle = ::GetWindowLong(GetSafeHwnd(), GWL_STYLE);
if(dwStyle & WS_VSCROLL)
{
::SetWindowLong(GetSafeHwnd(), GWL_STYLE, dwStyle & (~WS_VSCROLL));
}
but it doesnt work, I still have scrollbar
any suggestions?
thankx in advance
nobody is perfect
|
|
|
|
|
dwStyle &= LVS_NOSCROLL;
Signature space for rent. Apply by email to....
|
|
|
|
|
I need to hide only vertical scrollbar, horizontal should stay as is
nobody is perfect
|
|
|
|
|
Hello,
I have the same problem in horizontal scroll, i am trying to make it disappear.
i tried also in the OnSize same as you and it didn't work....
i would like to know if u solved the problem, if u did can u tell me how please?
thanks in advanced
Yaron
Ask not what the application can do for you, ask what you can do for your application
|
|
|
|
|
I want to insert pictures into the talbe of a .mdb(Access 2000)
database created by DAO classes(CDaoDatabase,
CDaoRecordSet, CDaoTableDef). I find CLongBinary useful but
i don't know how to use it at all. Could anyone elaberate on
the complete process of inserting pictures? Thanks a lot!
|
|
|
|
|
Hello world.
I simply want to get a double variable from an ini file...
Currently I get an integer by using:
GetPrivateProfileInt("MY SECTION", "MY KEY", default_value, Ini_file_name)
How to get a double variable?
GetPrivateProfileDouble(...) doesn't exist!
Thanks in advance
Hello World!!!
from Raphaël
|
|
|
|
|
I've by passed this problem by using GetPrivateProfileString and then atof
And that's work...
Hello World!!!
from Raphaël
|
|
|
|
|
Read a string and convert it to a double!
|
|
|
|
|
What's wrong with my code below ? I got an exception of accessing invalid address in the line InsertItem(&tvInsert).
Original, the code adds a TVIF_TEXT too, I thought it's the text buffer problem, but I removed, it's still the same.
One more quetion. If i use TVIF_TEXT mask, I'm using a CString to pass in a function for the tree item text. Should I "new" a buffer for the tvInsert.item.pszText or the control will copy it itself ??
TVINSERTSTRUCT tvInsert;
tvInsert.hParent = hParent;
tvInsert.hInsertAfter = TVI_LAST;
tvInsert.item.mask = TVIF_IMAGE | TVIF_PARAM;
tvInsert.item.iImage = 0;
TVITEMDATA *pitemdata = new TVITEMDATA;
pitemdata->itemtype = TVITEM_PKGETY;
pitemdata->itemkey = pPkgEty->GetPkgEntityKey();
tvInsert.item.lParam = (LPARAM) pitemdata;
HTREEITEM hItem = InsertItem(&tvInsert);
|
|
|
|
|
I m Doing Masters in computer sciences and now a days looking for my final project.
I want to devlop some application as my project, but i m not getting any idea what should i devlope, what type of application should i make and things like that.I will use visual c++ as develpment tool.
I need recommendations and suggestion from u ppl as what to develop as my project
if u have any idea ,
or if u could share any idea about any project that you have done that can help me, or any other info
Do tell me
Thankyou
|
|
|
|
|
My friend for his masters final project did an image recognition application. Think he's still slaving over it just now to be honest Seemed like a good project to do and quite interesting.
|
|
|
|
|
First, pick something doable and practical. Don't fool yourself into believing your going to discover some great algorithm. Something small and elegant will do more for you career wise, than something large, obscure and unfinished.
Second, what areas interest you? Do you like to database stuff or hate it? Do you prefer working at the UI level or the lower level? Command line?
Third, what turns on your advisor? For example, if he/she, hates BTrees, don't do something with BTrees.
Fourth, whatever you do, don't do AI, natural language recognition/translation, visual imagery resolution... All are much, much, much harder than most college students think and none are close to being solved. Moreover, some of these require additional education you may not be willing to do. Also avoid encryption and compression (directly at least), both have been done to death.
Fifth, whatever you pick, make sure you can do it with just MFC. I know some readers will disagree, but to keep the project simple and on track, avoid learning loads of new stuff. If you know STL, great, if not think twice if your goal is to complete the project. (In other words, minimize the new stuff you need to learn.)
Finally, I really suck at coming up with projects like this. I either come up with stuff so huge, it would take a team 18 months or something so simple, I do it in a week.
|
|
|
|
|
I have the problem, that the OnUpdate???(CCmdUI* pCmdUI) functions of my command bar will not be called, and so the buttons are always enabled!
I have a dialog with a command bar and some buttons, the click events works fine. The only thing is that the OnUpdate???(CCmdUI* pCmdUI) functions are not working! I have take some breakpoints in the functions, but the system never call this functions!
I am working with eVC++ 3.0!
--
Nice greets, Daniel.
|
|
|
|
|
Modal dialog? OnUpdate methods are called from main application message loop (CWinApp::OnIdle method), but modal dialogs have it's own message loop.
See Q123158 KB article[^] for details how to implement updating the control bars on dialog.
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks for the tip! I try it...
--
Nice greets, Daniel.
|
|
|
|