Deepak Khajuria wrote: hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, &psl); I get an error when giving &psl to CoCreateInstance... the error disappears when I cast it to a void** pointer... but then the call fails... Actually, what my only wish to do is to get the target path of a link and I know the path to the link. Any ideas?
Tommy H D Svensson
Posts
-
desktop shortcut -
How do I get a shotcut target path?Hi all, Given a string containing the shortcut name, how do I get the shortcut target path? I tried to use BOOL SHGetShortcutTarget(...) but to no avail... My MSC++ couldn't find it, even after including Shellapi.h and linking to Shortcut.lib. Any one has a clue on how to do this? Thx! /T
-
Come on you all, WMI can't be the only solution!!!!!Hi everyone, I've posted a thread regarding the retrieval of sound and graphics card info such as driver name, manufacturer and version. Many of the answers I have received all boils down to using WMI (Windows Management Instrumentation) but after using it I realize it's an enormous overkill for my simple needs and that it is not supported for win 95/98 unless you install it yourself. There must be another, more standard way to get the display and sound info, right...? If you know how or can point me in the right direction, I'd be VERY grateful! /Tommy
-
How can I get monitor and display specs/properties? #TSHi all, I wish to programmatically determine the monitor frequency (in Hz), the video card name and its manufacturer and version. Any one has any clue? Is there anything similar to GetDeviceCaps...? (Where's the GetDeviceCapsEx when you need it!? :)) If you're saying WMI, then please show me how to use it cause I stumped big time... /T
-
Challenge: How do you determine the physical dimensions of your pixels/monitor?Well, I appreciate your help, but the result is not real size... For instance, GetDeviceCaps(LOGPIXELSX/Y) returns a value that is fixed and doesn't depend on any physical settings made on the monitor or even changes made in resolution and physical monitor size. If it would, then everything would have been fine. Try for your self and measure your screen. /T
-
CListCtrl window disappears?!Hi Tomasz, I just got a solution to the problem with a little help from another Codeproject dude [thx Joel!]. The thing is that whenever a WM_ERASEBKGND is received by a CTabCtrl, all window children of CTabCtrl that are CListCtrls don't get properly repainted if they have been "focused". The fix is just to call RedrawWindow on the CListCtrl when ever appropriate. As always Tomasz, thx for your superb help and 'be there'-frequency! /Tommy
-
CListCtrl window disappears?!Yes, it did! It says the dialog is on top. But, from what I know the CListCtrl is a child window of the dialog and therefore the ctrl should be visible as well... or is it not a child window? Do I have to make an explicit call to m_List.Create from the dlg to make it a child? I always thought that I if I drag a ctrl on a dialog, the explicit creation of the ctrl is not needed since the wizard adds a variable for me and updates the DDX stuff... It's like the ctrl doesn't update its painting... Well, I'll send you a sample project. :) /T
-
CListCtrl window disappears?![Tomasz, please send me a mail instead because I have to poll for new messages... don't know why but I'm not getting any replies in my mailbox.] Yes, I clicked the tab -> the dialog with the CListCtrl showed up -> I clicked the CListCtrl somewhere -> tabbed away -> tabbed back -> the CListCtrl is gone. Now I wanted to check which window was on the top of the z-order by using GetTopWindow(). And I did this by reacting to a click on the dlg, not the CListCtrl, AFTER I had toggled back the app (that is when the CListCtrl had disappeared). So I set a breakpoint in the OnLButtonDown handler to check the handles for the dialog and the ctrl. If the CListCtrl is beneath the dialog then the handles of ctrl and top should NOT be equal. At least that's what I thought... void CsomeDlg::OnLButtonDown(UINT nFlags, CPoint point) { CWnd* ctrl = &m_List; CWnd* dlg = this; CWnd* top = GetTopWindow(); } The handles were all different... but that maybe depends on something else... what wa important here was that when I pressed F5 to continue running the app, the CListCtrl showed up again...?!?!
-
CListCtrl window disappears?!Hmm, I did like this - Added ON_WM_ACTIVATEAPP in the message map - Added the OnActivate method to one of the dialogs - Added a breakpoint at CDialog::OnActivate(...) but the breakpoint was never found... Did I do something wrong? /T
-
CListCtrl window disappears?!Also, I must add, when the CListCtrl is gone I can activate parts of it by clicking "on it"... It lights up row wise but the entire CListCtrl border doesn't show... Somehow it reacts to my mouse clicks. Is it then possible it is hidden by a window with higher z since it responds to user actions?
-
CListCtrl window disappears?!Yes you're right, no propertypage/sheet. But I tried to loacate which window is on top with GetTopWindow and from the result the CListCtrl should be on top, but maybe the result is incorrect when I'm in debug mode (see comments below). See if we can narrow the problem down. It works like this: I have my CTabStrl in the var m_TabCtrl. I've created several dialogs each of which is "activated" like this when I click on a tab: void CSystemInfoDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) { ActivateTab(m_TabCtrl.GetCurSel()); *pResult = 0; } void CSystemInfoDlg::ActivateTab(int nTab) { if (pCurDlg) { pCurDlg->ShowWindow(SW_HIDE); } pCurDlg = pDlgs[nTab]; pCurDlg->ShowWindow(SW_SHOW); } When I try to debug it works?!!? I'm clicking on a CListCtrl which is on every pDlgs and after toggling away the app and toggling it back and then doing something to reach a breakpoint and then continue with F5, the CListCtrl shows up again... But that doesn't happen if I don't debug... Any ideas? /T
-
Painting Problem with CListCtrlHi, Did you come up with a solution cause I have the same problem? Thx, /Tommy
-
CListCtrl RefreshingHi, Did you come up with a solution to this problem cause I have reached the exact same situation? /Tommy
-
CListCtrl window disappears?!Hi, Has anyone had this problem before: If I click in the CListCtrl in report view and ALT+TAB toggles to another program (which completly hides the control) and then toggles back to the app with the CListCtrl, the control disappears. However it works if I don't click the CListCtrl and performs the some thing as above. I've included the CListCtrl (report view) on a dialog which in turn is on a tab page. Any ideas anyone? /Tommy
-
Challenge: How do you determine the physical dimensions of your pixels/monitor?Ok, that's what I thought... But are you saying that you can create rulers in inches/centimeters using the LOGPIXELSX/Y? Ok, you can create them but they will not reflect the real size on screen right? Intuitively it feels like there's a solution to this... just gotta get someone to find it! :) /T
-
Challenge: How do you determine the physical dimensions of your pixels/monitor?Challenge: How do you determine the physical dimensions of your pixels/monitor? There must be a smart way of determining the real size of a pixel, or at least figuring out the width:height ratio! I can't believe that information has not been stored with the video driver but unfortunately it seems to be the case. Does anyone know of some clever way to work out the physical monitor view dimensions? Implicitly this could mean working out the real pixel size, pixel ratio, pixels per inch... I know there's information to retrieve using GetDeviceCaps but they are for some strange reason fix values. They don't change!!! Why is that? There's a huge prize waiting for you if you accept and solve this quiz/challenge... Well, not really, but I'd be very grateful! :) And measuring the screen by hand does not count! :) /Tommy
-
The browser and the registryCall RegQueryValueEx(...) with HKEY_CLASSES_ROOT, "http\\shell\\open\\command", "(Default)" and you should get the path to the application browser running as default. /Tommy
-
How to make flicker free dialog interface?I don't understand this piece of code... Where do you get CMemDC from? I don't have it? :( Also, why are you not calling BitBlt to eliminate flickering? Thx, /Tommy
-
Has somebody written a standalone splitter class?Of course, but are you telling me you have found something there?!
-
Has somebody written a standalone splitter class?Hi everyone, As my attempt to get CSplitterWnd to work the way I want has become a long process, I finally give up... There are bugs and stuff in CSplitterWnd which I can't get around and which I no longer have the strenght to deal with. Does anyone know of a standalone splitter class or is there anyone who can point me in the right direction for starting out on my own? Sincerely, /Tommy