|
|
I would like to develope an application in Win32, once run it should stay running and POPUP, when I press Special Keys i.e. Ctrl+Alt+R. Any help is highly appreciated.
|
|
|
|
|
WinAPILearner wrote:
when I press Special Keys i.e. Ctrl+Alt+R.
you can look for desktop intercative services
WinAPILearner wrote:
once run it should stay running
Yeah this can be successfuly accomplish using HOTKEYs
Use this api
RegisterHotKey
The RegisterHotKey function defines a system-wide hot key.
<br />
BOOL RegisterHotKey(<br />
HWND hWnd,
int id,
UINT fsModifiers,
UINT vk
);
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I could not find anything about:
desktop intercative services in CodeProject.
I use the function like:
iStat = RegisterHotKey(hwnd,77070,MOD_CONTROL && MOD_ALT, VK_R);
But I get 'VK_R' : undeclared identifier error?
Will appreciate a sample code.
|
|
|
|
|
WinAPILearner wrote:
I use the function like:
iStat = RegisterHotKey(hwnd,77070,MOD_CONTROL && MOD_ALT, VK_R);
use this
RegisterHotKey(this->m_hWnd,77070,MOD_CONTROL|MOD_ALT, 52);
or visit http://www.voidnish.com,it has good example For HotKey
WinAPILearner wrote:
I could not find anything about:
desktop intercative services in CodeProject.
You look for Services first,DESKTOP_INTRECTIVE_SERVICE is just Argument passed to CreateService when we create Service.
advantage of Desktop Intercative service is that it can interect with desktop.
you can also go for Hidden Dialog Application ,whichpopup on register Message
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Dear Mr. Alok Gupta,
Thank to you and Void Nish, the HOTKEY is Done.
I studied services.I want my application to be in "Windows Notification Area" like MSN Massager. Should I study Services or CreateProcess, or something else?
Please Note, my application will run on win 9x/2k/XP.
Is not good to not know, and is worse to not ask!
|
|
|
|
|
WinAPILearner wrote:
I want my application to be in "Windows Notification Area" like MSN Massager.
yeah FOr that you have create Sytem tray application that very simple.
BOOL Shell_NotifyIcon(<br />
DWORD dwMessage, <br />
PNOTIFYICONDATA lpdata<br />
);
or you can .lokk one of my article Shutdown alarm,i have used that concept in that
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Currently I am using the following piece of code to post data to a website
HRESULT hResult;<br />
hResult = HttpRequest.CreateInstance("Microsoft.XMLHTTP");<br />
<br />
if ( FAILED(hResult) )<br />
return bRetVal;
<br />
VARIANT vAsync;<br />
vAsync.vt = VT_BOOL;<br />
vAsync.boolVal = FALSE;<br />
<br />
VARIANT vUser;<br />
vUser.vt = VT_BSTR;<br />
vUser.bstrVal = NULL;<br />
<br />
VARIANT vPassword;<br />
vPassword.vt = VT_BSTR;<br />
vPassword.bstrVal = NULL;<br />
<br />
HttpRequest->open("POST", "http://web.cgi", vAsync, vUser, vPassword);<br />
HttpRequest->setRequestHeader("Content-Type", "application/x-www-form-urlencoded");<br />
<br />
CString szRequest = "static=1&entry_id=328&name=R&email=r@r.com";<br />
<br />
VARIANT vRequest;<br />
vRequest.vt = VT_BSTR;<br />
vRequest.bstrVal = szRequest.AllocSysString();<br />
<br />
HttpRequest->send(vRequest);<br />
<br />
m_lHttpStatus = HttpRequest->status;<br />
m_szHttpStatusText = (char*)HttpRequest->statusText;<br />
<br />
_bstr_t bsResponse = HttpRequest->responseText;
Everything is going fine the data is posted through the code and OK is retutrned.
But when i view the website the data is not there.
It seemd that the data is not posted to the web.
Am i doing everything right- Is there any opther way to do so.
PLease help me out.
|
|
|
|
|
IS your Webserver provide support for Posting data from application.
Returning OK means that The Url you requested is Found,this Ok dosn't tell any thing about the your data posting is successful.
data posting always come witha html file in return,try to read that file,it may contain possible error description
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
_bstr_t bsResponse = HttpRequest->responseText;
The above line contains the contents of the HTML Page.
But the problem is that It only contains first few lines.
The tag is not even complete in the string.
Dont know how to get it.
Can it be done thru some other way.
|
|
|
|
|
Yeah Buddy,
ther is very good Class named AmHttpSocket or amHttpFile in Internet Section , it hink that will help you out.
or ucan use InternetReadFile Api's if you dunno want ot use MFC based CInterneSession Class.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
includeh10 wrote:
any idea to create a serch engine in c++ for web-pages?
yeah that very simple,
you have read Webpages for keywords,meta tag etc. and store them in your database.
and rest ithink you know
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hain buddy,
buddy but Searching are done on based on Internet Files only naa
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi experts,
I found a really easy example on how to create a dll to hook the open/save dialogs to customize, but it says to "call it from VB", but I don't have Visual Basic installed, I'm using VC++ 6.
How do I create a simple application to test the dll in VC++? I've tried all the tutorials here which all work great for those examples, and searched forever on Google, but I keep getting errors no matter what I try for this particular project.
I'm a real c++ newbie, please help, I'd be so grateful.
|
|
|
|
|
Hi Buddy,
you can call that DLL Function By two Ways
#1 Via using LoadLibrary %GetProcAddress Func
#2 including the headr file and Libaray file in your project and directly calling function.
UnderStand ,i Don't think so.
here is example for both using your's iPong.dll
#1 Using LoadLibaray
Declare Function in your calling Client
typedef BOOL (WINAPI *MYOPENFILENAME)(HWND, LPTSTR, LPTSTR);<br />
<br />
typedef BOOL (WINAPI *MYGETSAVEFILENAME)(HWND, LPTSTR, LPTSTR);
Now use LoadLibrary function to Dynamic Load Libaray
MYOPENFILENAME myFunc1;<br />
<br />
HMODULE hPong=::LoadLibrary("ipong.dll");<br />
<br />
if(hPong)<br />
{<br />
myFunc1=(MYOPENFILENAME)::GetProcAddress(hPong,"MyGetOpenFileName");<br />
<br />
if(myFunc1)<br />
{<br />
(myFunc1)();<br />
<br />
}<br />
<br />
}
i think our method is little tough for Beginner you can try second method it's little easy.
#2 modify the code of IPong add a header file Ipong.h
and add these two function to it
BOOL __stdcall MyGetOpenFileName(HWND, LPTSTR, LPTSTR);<br />
BOOL __stdcall MyGetSaveFileName(HWND, LPTSTR, LPTSTR);
and add this header file to ipong.cpp
#include "stdafx.h"
#include "resource.h"
#include "ipong.h"
now recompile and again make dll.
now copy ipong.h,ipong.lib into you calling client Sourec code and use them as simple function.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you very much for taking the time to look at the example and offering help I appreciate it so much . Unfortunately, I can't seem to get it to work, however thanks to your examples I can now load the library file following both examples. I just don't know how to return the MyGetOpenFileName?
I tried creating a simple application as console to return that the library loaded, and I've tried a dialog based app. Ugh! I'm such a newbie, I don't get what function needs to be added so that the dll is hooking the dialog box? Any ideas - I hope I make sense?
Thank-you once again.
|
|
|
|
|
Hello ,
Really i can't Understand what you want to say.
i am sorry.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I'm sorry I did not make my self clear Thanks for looking again. First I'm trying to learn how to do this from step one, eventually I'd like this dll to be part of a system process.
For example, after trying to do this on my own with a simple console application and failed, I tried to add ipong in an example app I found here. But I don't know how to return function MyGetOpenFileName(); or if I use your first example (myFunc1)(); ?
<br />
if(myFunc1)<br />
{<br />
(myFunc1)();<br />
}<br />
Any pointers? I feel so stupid for asking, I searched Google to help me find an answer but I don't understand how to do it in this project?
Kind Regards.
|
|
|
|
|
mjeb Brother if you don't mind,i amlittle busy these day can you give me thre or four day to solve your problem
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
mjeb Brother if you don't mind,i amlittle busy these day can you give me thre or four day to solve your problem
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I don't mind at all Please don't feel the need to help unless you have the time, I'm already extremely grateful that you responded to my query
If you do post again and I find the solution before then, I promise to let you know. Thank-you once again.
|
|
|
|
|
Here you are:
#include <windows.h>
typedef BOOL (__stdcall * MYGETOPENFILENAME)(HWND ghWnd, LPTSTR szName,
LPTSTR szInitDir);
MYGETOPENFILENAME MyGetOpenFileName;
static void ShowLastError()
{
LPVOID lpMsgBuf;
if (!FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
return;
}
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONERROR );
LocalFree( lpMsgBuf );
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
TCHAR filename[MAX_PATH];
HMODULE hDll = LoadLibrary(TEXT("ipong.dll"));
if (NULL != hDll)
{
MyGetOpenFileName = (MYGETOPENFILENAME) GetProcAddress(hDll, TEXT("MyGetOpenFileName"));
if (NULL != MyGetOpenFileName)
{
lstrcpy(filename, TEXT("test.txt"));
if(MyGetOpenFileName(NULL, filename, TEXT("C:\\")))
{
MessageBox(NULL, filename, TEXT("Testing"), MB_OK);
}
}
else
{
ShowLastError();
}
FreeLibrary(hDll);
}
else
{
ShowLastError();
}
return 0;
}
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Wow, you are too kind Thank-you very much, I've been at this for days, you should see the codes I came up with Aaah!
I'm learning more though, I just learned yesterday that the WINAPI in the typedef should of been __stdcall like your code does, my progress was as far as error checking the code up until MyGetSaveFileName. I couldn't get the function FileOpenHookProc to return.
However besides reading all the DLL articles I could find, I found one nice little program to help my progress. Maybe others will like it too. This is my first attempt at a project aside from "Hello World"
Once again, thank-you your code works perfectly and the comments were an excellent helper!
Many Many Regards
|
|
|
|
|
How can I get the height of a given font (or one, which has yet to be created) in PIXELS (not in points and not in logical units)?
Another question in the same direction: where do I find the "DPI setting" of the monitor? I don't mean the physical setting but the one in the Display Properties, Settings, Advanced (the term "DPI" is used incorrectly in this context, but that's how Microsoft named it).
|
|
|
|
|
|