|
|
But this still does not fix your problem as far as I can see. It is still not possible to get the information out of the .lnk file. Or have I missed some extra information?
The best things in life are not things.
|
|
|
|
|
That is completely incomprehensible, so I'll have to go for a very wild guess.
If you make a shortcut file containing a URL (e.g. by dragging the content of the address bar from a browser to the desktop), then you get what is basically a text file; the second line contains
URL=the URL your browser was showing at the time
so some simple read-string-from-file operations can give you the URL string.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Exactly right Luc. However, OP had a .lnk file which contained a URL as the link rather than a file path, but was still not in URL shortcut format, and could not be read via the IShellLink interface. The issue is in the Delphi forum, and I'm not sure why he posted the above message as it still does not contain a resolution as far as I can tell.
The best things in life are not things.
|
|
|
|
|
OK, I now have read some of that Delphi thread, seems like a bit of a scatterbrain.
BTW, it seems an LNK file isn't text, are you aware of this?
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
Luc Pattyn wrote: LNK file isn't text
Yes, and that is the problem. A URL link (correctly constructed) is a text file and can be read easily. A .lnk file uses some internal Microsoft (not published) structure, and you can only access its content through the IShellLink interface. The file that the OP has is a 'normal' .lnk file but its path contains a URL, which is illegal. So, you cannot read it as a text file and the IShellLink functions will not give you access to its contents either. Catch 22.
The best things in life are not things.
|
|
|
|
|
Delete the illegal file and move on, I'd say.
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
|
Thank you every body finally an answer that works
http://forums.about.com/n/pfx/forum.aspx?msg=19194.13&nav=messages&webtag=ab-delphi[^]
|
|
|
|
|
The PostQuitMessage function posts a WM_QUIT message to the threads message queue and returns immediately; the function simply indicates to the system that the thread is requesting to quit at some time in the future.
I want to quit my application so that the application ends immediately and does not go beyond that point. When using the PostQuitMessage(0) the application continues after that line and stops after executing a few functions.
Kindly provide suggestions.
|
|
|
|
|
TerminateProcess[^], Though it is not a good suggestion to use this, this might just fit your need here perfectly.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
|
|
You may wish to use exit()[^].
The best things in life are not things.
|
|
|
|
|
why not just wait for the thread to quit ?
if (needToQuit)
{
PostQuitMessage
WaitForSingleObject(threadHandle)
quit the main app
}
|
|
|
|
|
If you need to quit the application, use Richard's advice, if you need to quit a thread, use TerminateThread (a couple of people suggested) but be aware that doing that creates memory leaks as the threads working memory is not properly deallocated... so you shouldn't do the operation very often and only when its absolutely necessary, in most cases, you can creatively code a solution that allows a thread to properly shutdown... for example if the thread is processing some data, then you can have a control variable that'll stop the processing (within the thread) until WM_QUIT message is processed.
|
|
|
|
|
posted on my blog with due reference of your name!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
No prob 
|
|
|
|
|
The program running in xp is no problem ,bu in Win7 ,it doesn't use the CreateRemoteThread to inject a dll to other process.
if I use the administrator to run,is also failed !
It's there any where to do this in Win7/Vista ?
I found this note: http://www.codeproject.com/Messages/3625827/It-dont-work-on-64bit-win7-system.aspx[^]
but I can't open the url, because the country's gateway shield it.
Thanks for your reply !
Best Regards !
|
|
|
|
|
I always used SetWindowsHookEx to inject dlls into other processes.
Dr D Evans "The whole idea that carbon dioxide is the main cause of the recent global warming is based on a guess that was proved false by empirical evidence during the 1990s" financialpost
|
|
|
|
|
Thanks ! 
|
|
|
|
|
Hi, this is the code:
case WM_MOUSEMOVE:
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
InvalidateRect(hWnd,NULL,TRUE);
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
memDC = CreateCompatibleDC(hdc);
SelectObject(memDC,hbmp);
GetObject(bmp, sizeof(bm), &bm);
GetClientRect(hWnd,&rcc);
StretchBlt(hdc,
0,0, rcc.right,rcc.bottom,
memDC,
0,0,bm.bmWidth, bm.bmHeight,
SRCCOPY);
MoveToEx(hdc, pt.x , 0 , NULL);
LineTo(hdc, pt.x, rcc.bottom);
MoveToEx(hdc, 0, pt.y, NULL);
LineTo(hdc, rcc.right, pt.y);
how can i draw lines on mouse move without repainting the background bitmap? There's a way to "fix" the bitmap on background and repaint only lines?
|
|
|
|
|
InvalidateRect(hWnd,NULL,TRUE);
The third parameter tells the system whether to erase the background on the next call to BeginPaint() ; change it to FALSE to prevent the erase. You can also trap the WM_ERASEBKGND message and provide your own code to redraw the background however you like.
The best things in life are not things.
|
|
|
|
|
thanks works, but why when i resize or maximize the window it doesn't work very well?
|
|
|
|