|
Richard MacCutchan wrote: Show the contents of your URL so people can see if it is valid.
It's here:
http://[^]
|
|
|
|
|
No I did not mean post a link to the site, I mean show the exact value that is in the variable at the time you get the error.
The best things in life are not things.
|
|
|
|
|
The error does not occur in my system. It occurs at a target machine. So I can't trace the value by debugging.
modified on Thursday, May 26, 2011 9:28 AM
|
|
|
|
|
You really need to go away and think about the details of this problem and how you can provide a clear explanation of :
- what you are trying to achieve
- what your code is doing
- what are the actual values of any variables that the code is using
- what results you are seeing
These vague one line statements are not a lot of help, I'm afraid.
The best things in life are not things.
|
|
|
|
|
I would go for ShellExecute()[^]. It will open a document, in this case your URL, in the default application, in this case the default web browser.
|
|
|
|
|
It shows the following error:
APPLICATION ERROR:
This error has occurred for one of the following reasons:
(i) You have kept the browser window idle for a long time. Your session has expired.
(ii) You have logged in from another browser window.
(iii) You are accessing the application URL from a saved or static page.
|
|
|
|
|
Was the URL retrieved during a authenticated session? Then you're in trouble.
|
|
|
|
|
Yes. But I've to open this URL with the default browser in a System. How to do this?
|
|
|
|
|
Is it an option to open the website in your default browser and log in to the site manually, before trying to open the link? That could work.
|
|
|
|
|
Hi all,
How can i get the handle of the the window(i.e other dialog),if it doesnt have Windows caption.
I am trying with this code,
HWND hWnd1;
hWnd1=::FindWindow(NULL,"Test");
if(hWnd1!=NULL)
{
::SetDlgItemText(hWnd1,IDOK,"sadsd");
}
If i dont have caption means,how can i change the text.If any one has any idea,please let me know
Thanks
Manju
|
|
|
|
|
Hello,
in place of NULL you can try using class name (of dialog).
otherwise, you can use EnumChildWindows(...) and GetWindowText(..) to find the appropriate window and get hwnd.
Regards,
A. Gopinath.
|
|
|
|
|
Is it custom window application, where you want to change the caption of the window or it would going to be generic one. if it custom window: you can use findwindow and findwindowex to search the window application using windowclass, otherwise follow the method told in earlier post
"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
|
|
|
|
|
I am using firefox and dreamweaver for my webprojects.
when firefox or dreamweaver is closed they take a long time clearing all the virtual memory and things like that. so mostly i invoke taskmanager and end task firefox and dreamweaver. I dont have valuable information stored neither in ff nor in dreamweaver so abnormal termination is not a problem i think.
I wanted to write a win32 api program which when executed should find firefox or dreamweaver and should terminate them abruptly like what we do as endtask using taskmanager.
So i want to know where do i have to start in the documentation of windows programing to do some thing like this.
References, suggestions, answers and external links could be useful.
Thank You.
|
|
|
|
|
system("taskkill /F /IM <processname>") should help, see if it fits your needs
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
 I guess you're in luck. I had this same idea and wrote a piece of code, using the two documentations linked by the other poster. The following code searches for the Windows Media Player Tray Control, terminates it, and then starts it again.
I'm sure you can modify it quite easily to work for your situation.
BOOL FindTrayProcess( DWORD& pid );
void PrintError( TCHAR* msg );
int _tmain(int argc, _TCHAR* argv[])
{
DWORD pid;
HANDLE hTray;
TCHAR szPath[MAX_PATH+1] = TEXT("C:\\Program Files\\Windows Media Bonus Pack for Windows XP\\PowerToys\\mpxptray.exe");
STARTUPINFO si;
PROCESS_INFORMATION pi;
if (FindTrayProcess( pid ))
{
if (INVALID_HANDLE_VALUE == (hTray = OpenProcess( PROCESS_TERMINATE, FALSE, pid )))
{
PrintError(TEXT("OpenProcess"));
}
else
{
if ( ! TerminateProcess( hTray, 0 ) )
PrintError(TEXT("TerminateProcess"));
CloseHandle(hTray);
}
}
memset( (void*)&si, 0, sizeof(STARTUPINFO) );
si.cb = sizeof(STARTUPINFO);
memset( (void*)&pi, 0, sizeof(PROCESS_INFORMATION) );
if ( ! CreateProcess( szPath, NULL, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi ))
{
DWORD ErrCode = GetLastError();
PrintError(TEXT("CreateProcess"));
return ErrCode;
}
CloseHandle( pi.hThread );
CloseHandle( pi.hProcess );
return 0;
}
BOOL FindTrayProcess( DWORD& pid )
{
HANDLE hProcessSnap;
PROCESSENTRY32 pe32;
hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
if( hProcessSnap == INVALID_HANDLE_VALUE )
{
PrintError( TEXT("CreateToolhelp32Snapshot") );
return( FALSE );
}
pe32.dwSize = sizeof( PROCESSENTRY32 );
if( !Process32First( hProcessSnap, &pe32 ) )
{
PrintError( TEXT("Process32First") );
CloseHandle( hProcessSnap );
return( FALSE );
}
do
{
if (_tcsicmp( pe32.szExeFile, TEXT("mpxptray.exe") ) == 0 )
{
pid = pe32.th32ProcessID;
CloseHandle( hProcessSnap );
return( TRUE );
}
} while( Process32Next( hProcessSnap, &pe32 ) );
CloseHandle( hProcessSnap );
return( FALSE );
}
void PrintError( TCHAR* msg )
{
DWORD eNum;
TCHAR sysMsg[256];
TCHAR* p;
eNum = GetLastError( );
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, eNum,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
sysMsg, 256, NULL );
p = sysMsg;
while( ( *p > 31 ) || ( *p == 9 ) )
++p;
do { *p-- = 0; } while( ( p >= sysMsg ) &&
( ( *p == '.' ) || ( *p < 33 ) ) );
_tprintf( TEXT("\n WARNING: %s failed with error %d (%s)"), msg, eNum, sysMsg );
}
You'll need to include tlhelp32.h for the process snapshot. Hope this helps
Best Regards,
MicroVirus
|
|
|
|
|
MicroVirus wrote: I had this same idea and wrote a piece of code, using the two documentations linked by the other poster
Cool!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks or all the replies. Let me trial and error it.
|
|
|
|
|
To open a help (chm) file i use below function
ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm"),NULL,NULL,SW_SHOW);
and it works. But when i want to open any particular page of chm file using below function it does not work
ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm::/page1.html"),NULL,NULL,SW_SHOW);
Please suggest how to open any page
|
|
|
|
|
MKC002 wrote: ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm::/page1.html"),NULL,NULL,SW_SHOW);
Have you tried:
ShellExecute(this->m_hWnd, _T("open"), "hh.exe", _T("HelpSample.chm::/page1.html"), NULL, SW_SHOW);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Shouldn't be also _T("hh.exe") ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm not sure if ShellExecute() "open" will do that for you like that.
You could try something like
CreateProcess("hh.exe", " drive:\\path\\HelpSample.chm::/page1.html", ...);
*edit* or try David's method above
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If this is a help (chm) file you have created yourself, you can open any page by using the topic ID stored for that page, using function HtmlHelp().
|
|
|
|
|
This will work,
::HtmlHelp(NULL, _T("HelpSample.chm::/html/page1.html"), HH_DISPLAY_TOPIC, 0);
http://www.mono-project.com/Main_Page
|
|
|
|
|
In a list control , which is message to edit an item , like in list-control of Windows Explorer ? It's an second click , but is not double-click ... if you know what I mean ...
Thanks.
P.S. Actually , I have edit procedure on dblclick event , but this one I need to use on something else.
|
|
|
|
|