|
You need to take a look at RAS. (Remote Access Service).
There's a couple of articles here on CodeProject that shows how to do that. Just search for RAS...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
How can I enable-disable, show-hide system buttons (minimize, close etc.) runtime (buttons in the top right corner of dialogs)?
Thanks in advance
|
|
|
|
|
You can write this:
hMenu=GetSystemMenu(hDlg,TRUE);
EnableMenuItem ( hMenu, SC_CLOSE, MF_BYCOMMAND | MF_DISBALED);
|
|
|
|
|
I have not the menu!
I want get pointer to the buttons into the caption of Dialog (Help and Close)!
|
|
|
|
|
Can anyone tell me ho to use RegisterServiceProcess
I need to register my application as service
but rhis function is undocmented api
any help or resources about undocmented api
would be nice
MR.Byte
|
|
|
|
|
|
I need to create a shortcut on the desktop by my
program
note: I Know nothing about shell programming
thanks in advance
MR.Byte
|
|
|
|
|
The following code should do:
HRESULT CreateShortcut(LPCSTR pszShortcutFile, LPSTR pszLink,
LPSTR pszDesc)
{
HRESULT hres;
IShellLink* psl;
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, &psl);
if (SUCCEEDED(hres))
{
IPersistFile* ppf;
hres = psl->QueryInterface(IID_IPersistFile, &ppf);
if (SUCCEEDED(hres))
{
WORD wsz[MAX_PATH];
hres = psl->SetPath(pszShortcutFile);
if (!SUCCEEDED(hres))
AfxMessageBox("SetPath failed!");
hres = psl->SetDescription(pszDesc);
if (!SUCCEEDED(hres))
AfxMessageBox("SetDescription failed!");
MultiByteToWideChar(CP_ACP, 0, pszLink, -1, wsz, MAX_PATH);
hres = ppf->Save(wsz, TRUE);
ppf->Release();
}
psl->Release();
}
return hres;
}
Deepak Khajuria
|
|
|
|
|
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?
|
|
|
|
|
Hi,
I have a problem in getting the no of windows open under the Windows menu when i create my own dynamice menu. If i load the menu from the resource all the opened windows are displayed under the Windows menu by default. How to get the same functionality in my dynamic menu under any one of the menu items.
Thanks in Advance
San
|
|
|
|
|
AFAIK, you have to enumerate all MDI child windows yourself and add menu items yourself. Your mainframe window has an undocumented member, m_hWndMDIClient, which is a parent for all child frames. You should use EnumChildWindows with MDI client to get the HWNDs of MDI children. GetWindowText will give you the captions.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
i made an COM - Server, works fine.. now i've tried to add a Method to the Interface with a HWND as Paramter .. it compiles well, but the linker is shouting?? do you know which lib i forgot to include..
TEST_p.obj : error LNK2001: unresolved external symbol _HWND_UserFree@8
TEST_p.obj : error LNK2001: unresolved external symbol _HWND_UserUnmarshal@12
TEST_p.obj : error LNK2001: unresolved external symbol _HWND_UserMarshal@12
TEST_p.obj : error LNK2001: unresolved external symbol _HWND_UserSize@12
thanks in advance
bernhard
""Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
I was under the impression you were constrained in what parameters could be passed into a COM object, and that HWND was not one of them. It's just a long, why don't you try to pass it as one ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Add ole32.lib to your TESTps.mk link build rule. It should look something like:
TESTps.dll: dlldata.obj TEST_p.obj TEST_i.obj
link /dll /out:TESTps.dll /def:TESTps.def /entry:DllMain dlldata.obj TEST_p.obj TEST_i.obj \
kernel32.lib rpcns4.lib rpcrt4.lib ole32.lib oleaut32.lib uuid.lib \
|
|
|
|
|
I attached tooltips to buttons derived from CWnd. Tooltips are shown only when EnableWindow( false) of selected button. How can I enable tooltips for buttons which have EnableWindow( true) ?
Hans
---------------
ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify)
BOOL CKurzzeitDlg::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
CString csTipText;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
if(nID)
{
// Select which Control has been hit by cursor
switch( nID)
{
case IDC_BUTTON1:
csTipText = "My Text";
break;.... }
m_Button.EnableWindow( false); -> I´ll have Tooltips
m_Button.EnableToolTips( true);
m_Button.EnableWindow( true); -> No Tooltips are shown
|
|
|
|
|
Did you set the Notify style for each of the buttons in the dialog editor?
Roger Allen the man
|
|
|
|
|
Can you please give me source code for the second way?I'm loading items from a database
|
|
|
|
|
Basically, you want to avoid copying text during combobox load. Each item is marked as 'callback' - whenever combo actually needs the text (when it needs to repaint or show the dropdown list), it will ask your app. The loading is simple - you just pass LPSTR_TEXTCALLBACK as item text.
COMBOBOXEXITEM cbitem;
cbitem.mask = CBEIF_TEXT;
imax = ...;
for (int i = 0; i < imax; i ++)
{
cbitem.iItem = i;
cbitem.pszText = LPSTR_TEXTCALLBACK;
m_cbx.InsertItem(&cbitem);
}
Then, you should handle CBEN_GETDISPINFO notification in the parent window (probably this will be a dialog, property page or formview). Use ClassWizard to add the appropriate handler.
void CYourDialog::OnGetdispinfoNodeType(NMHDR* pNMHDR, LRESULT* pResult)
{
NMCOMBOBOXEX *pNMCBX= (NMCOMBOBOXEX *)pNMHDR;
pNMCBX->ceItem.pszText = someTable[pNMCBX->ceItem.iItem];
*pResult = 0;
}
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Does anyone know how to find installed application on computer, like application listed in Add/Remove programs icon.
Thank's a lot.
|
|
|
|
|
Look up this Registry Key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Nish
|
|
|
|
|
Add/Remove stores the list in the Registry. You can read from the same location to find the apps installed.
On 2000 the path is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Deepak Khajuria
|
|
|
|
|
Ok,
Thank's a lot everybody.
But now my other problem is how to find "the start program file" for each entry (i have just the uninstall program in this registry key).
Sorry for my english
|
|
|
|
|
Uninstall branch in the registry doesn't contain filenames of application itself - note that sometimes one uninstall removes more than one .exe.
Depending on your definition of 'installed applications' you should look elsewhere. Maybe you should just scan the start menu?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Could you tell me how scan the start menu ?
Thank's in advance
|
|
|
|