|
When the Autocomplete list comes up, you can select an item from the list and hit the Delete key. I do not know of a way to do this programmatically.
|
|
|
|
|
Is there some way of getting a HWND from a long value?
|
|
|
|
|
Raggamuffin wrote:
Is there some way of getting a HWND from a long value?
Assuming that the long truly is a HWND you can cast it:
HWND hWnd = static_cast<HWND>( LongValue );
if ( ::IsWindow( hWnd ) )
;
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Along the lines of the suggestion above, if there is no acceptable conversion to your HWND, and you are certain you know what you're doing, you can try:
HWND hWnd = reinterpret_cast<HWND>(lYourLong);
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
And Why not?
HWND hwnd = (HWND)lValue; ;)
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Because being the good C++ programmers we are we should never use old style C casts anymore. On a more serious note I had a serious problem a few years back using a C style cast, and changing it to the new C++ casts resolved it. Since then I've completely stopped using C style casts.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I'm using a tab control that will contain several different dialogues. The tab control works fine and all the dialogues show up nicely but none of the buttons in the dialogues work...
Just to test i want the button to popup a Messagebox to check that it works. I've tried alot of stuff like using DoModal and calling a function from the parent window but that doesnt work either.
So now im asking if anyone else has used a tab control with child windows as tab pages. And if so maby they know were i've made mistakes
The tabs a added to a CObArray called m_oaTab:
CDialog* temp1 = new CDialog;
temp1->Create(IDD_DIALOG1, &m_tabben);
m_oaTab.Add(temp1);
CDialog* temp2 = new CDialog;
temp2->Create(IDD_DIALOG2, &m_tabben);
m_oaTab.Add(temp2);
CDialog* temp3 = new CDialog;
temp3->Create(IDD_DIALOG3, &m_tabben);
m_oaTab.Add(temp3);
//m_tabben is the CTabCtrl variable
m_tabben.InsertItem(0, "Tab nummer 1");
m_tabben.InsertItem(1, "Tab nummer 2");
m_tabben.InsertItem(2, "Tab nummer 3");
m_uiLastDlg1 = 0;
NMHDR pNMHDR;
long uiRes;
pNMHDR.idFrom = IDC_TAB1;
OnSelchangeTab1(&pNMHDR, &uiRes);
And here is the OnSelChangeTab1 method
void CTabbarDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
UINT uiCurDlg;
WINDOWPLACEMENT winp;
CRect rect;
m_tabben.GetWindowPlacement(&winp);m_tabben.GetWindowRect(&rect);
winp.rcNormalPosition.top = 25;
winp.rcNormalPosition.left = 5;
winp.rcNormalPosition.bottom = rect.Height() -5;
winp.rcNormalPosition.right = rect.Width() - 5;
uiCurDlg = m_tabben.GetCurSel();
((CDialog*)m_oaTab[uiCurDlg])->SetWindowPlacement(&winp);
((CDialog*)m_oaTab[m_uiLastDlg1])->ShowWindow(FALSE);
((CDialog*)m_oaTab[uiCurDlg])->ShowWindow(TRUE);
m_uiLastDlg1 = uiCurDlg;
*pResult = 0;
}
I know its not to easy to look at someone elses code and try to find faults (or perhaps it is in my case ) but maby you know what mistakes people "usually" do
thanx
/Eric
|
|
|
|
|
Why don't you use the CPropertySheet? it's like the tab control but it allow you to handle all the dialog events (the ones that happen in the pages) in each page...
it is very very easy to use a property sheet...
you have only to add the pages you want and you are done...
each page is a dialog that can be programmed as you program normal dialogs...
Hope this helps...
|
|
|
|
|
thanx for your reply
actually i've never used property sheets before (never used tab control either ) how do i add a property sheet in the resource view? or do i have to do everything in code?
thanx
/Eric
|
|
|
|
|
you have to do everything by code...
but it is very easy:
----------------------------------------------------
here's how to embed a property sheet inside a dialog box: (THE HARD ONE)
this->m_pPSEstacio = new CPSEstacio("", this, 0);
this->m_pPSEstacio->Create(this, WS_CHILD | WS_TABSTOP | WS_VISIBLE);
this->m_pPSEstacio->ModifyStyleEx(0,WS_EX_CONTROLPARENT);
take a look at the documentation... (it's easier than it seems...)
----------------------------------------------------
Creating a modal property sheet
you've only to call DoModal()...
Hope this helps...
|
|
|
|
|
yes i already got it to work before i read your post but thank you so much for your help, this is much easier than tab control
/Eric
|
|
|
|
|
I am constructing one add-in and I need to make a compilation similar to which is made with the Visual C++ 6 (with f7 or button in the menu).
I have two problems:
1) I found an example of Microsoft in:
http://msdn.microsoft.com/code/defa...mmands_cpp.asp.
The peculiar thing is that this page no longer exists (you can watch it in the cache of google).
The problem is that the code is not correct (I thing), in line:
int nNumWorkspaces = AfxGetApp()->GetProfileInt(_T("Configure"), _T("NumWorkspaces"), 0);
The value by defect that is taken is always zero , although you have one or several workspaces open; therefore never it compiles.
SOME SOLUTION?
2) The methods that make the single compilation only can be in the CComands class, and I need the compilation is made when pressing certain button that is in a CDialog that is created in the Ccomands class. (CComands only creates a CDialog, which has certain controls, and one of them is the button with the compilation function).
SOME SOLUTION?
Thanks to all.
PS1: This is the code:
<br />
...........................<br />
...........................<br />
<br />
STDMETHODIMP CCommands::Herram_testCommandMethod() <br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
<br />
<br />
VERIFY_OK(m_pApplication->EnableModeless(VARIANT_FALSE));<br />
<br />
......................<br />
......................<br />
<br />
CDialogMenu dlg_Menu(NULL, strFullPath, strName, strProjectPath, strProjectName); <br />
int r;<br />
r=dlg_Menu.DoModal();<br />
<br />
<br />
....................<br />
....................<br />
<br />
VERIFY_OK(m_pApplication->EnableModeless(VARIANT_TRUE));<br />
<br />
return S_OK;<br />
}<br />
<br />
STDMETHODIMP CCommands::AutoBuildTest() <br />
{ <br />
if (m_bBuildInProgres) <br />
return S_OK; <br />
<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState()); <br />
<br />
m_pApplication->EnableModeless(VARIANT_FALSE); <br />
m_nTotalErrors = 0; <br />
m_nTotalWarnings = 0; <br />
<br />
m_bAutoBuilding = TRUE;
m_bBuildInProgres = TRUE;
<br />
long lCount; <br />
int nNumWorkspaces = AfxGetApp()->GetProfileInt(_T("Configure"), <br />
_T("NumWorkspaces"), 0); <br />
<br />
for (int nWorkspaceNumber = 1 ; nWorkspaceNumber <= nNumWorkspaces ; <br />
nWorkspaceNumber++) <br />
{ <br />
char RegKey[50]; <br />
wsprintf(RegKey, "Workspace%d", nWorkspaceNumber-1); <br />
CComBSTR bszWorkspacePathName = AfxGetApp()->GetProfileString( <br />
_T("Configure"), RegKey, ""); <br />
<br />
CComPtr<IDispatch> pDispDocuments; <br />
VERIFY_OK(m_pApplication->get_Documents(&pDispDocuments)); <br />
<br />
CComVariant OleVariant;
<br />
CComQIPtr<IDocuments, &IID_IDocuments> pDocuments(pDispDocuments); <br />
<br />
CComPtr<IDispatch> pWorkspace;
VERIFY_OK(pDocuments->Open(bszWorkspacePathName, OleVariant, <br />
OleVariant, &pWorkspace)); <br />
<br />
CComPtr<IDispatch> pDispProjects; <br />
<br />
VERIFY_OK(m_pApplication->get_Projects(&pDispProjects)); <br />
CComQIPtr<IProjects, &IID_IProjects> pProjects(pDispProjects); <br />
VERIFY_OK(pProjects->get_Count(&lCount)); <br />
for (long i = 1 ; i < lCount+1 ; i++) <br />
{ <br />
long lNumConfigs; <br />
CComVariant Vari = i; <br />
<br />
CComPtr<IGenericProject> pGenProject; <br />
VERIFY_OK(pProjects->Item(Vari, &pGenProject)); <br />
CComQIPtr<IBuildProject, &IID_IBuildProject> pProject(pGenProject); <br />
CComPtr<IConfigurations> pConfigs; <br />
VERIFY_OK(pProject->get_Configurations(&pConfigs)); <br />
VERIFY_OK(pConfigs->get_Count(&lNumConfigs)); <br />
for (long j = 1 ; j < lNumConfigs+1 ; j++) <br />
{ <br />
CComVariant Varj = j; <br />
CComPtr<IConfiguration> pConfig; <br />
VERIFY_OK(pConfigs->Item(Varj, &pConfig)); <br />
<br />
CComVariant VarDisp = pConfig; <br />
CComBSTR bszStr; <br />
VERIFY_OK(pConfig->get_Name(&bszStr)); <br />
if (m_bMailOnEach == TRUE) <br />
m_strBuildingConfigurationName = bszStr; <br />
else <br />
m_strBuildingConfigurationName += CString(", ") + <br />
CString(bszStr); <br />
VERIFY_OK(m_pApplication->Build(VarDisp)); <br />
} <br />
} <br />
} <br />
<br />
m_bAutoBuilding = FALSE;
<br />
m_pApplication->EnableModeless(VARIANT_TRUE); <br />
<br />
if (m_bTesting == FALSE) <br />
{ <br />
if (m_bCloseWhenDone == TRUE) <br />
VERIFY_OK(m_pApplication->Quit()); <br />
} <br />
else <br />
{ <br />
if (m_bCloseWhenDone == TRUE) <br />
AfxMessageBox("IDS_WARNEXIT"); <br />
} <br />
return S_OK; <br />
} <br />
<br />
STDMETHODIMP CCommands::AutoBuild() <br />
{ <br />
AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
m_bTesting = FALSE;<br />
AutoBuildTest();<br />
m_bTesting = TRUE; <br />
<br />
return S_OK; <br />
}
PS2: Sorry for my bad English
|
|
|
|
|
does anybody already solved problem how to work with file history last open files automatic saving
i found my sw configuration saves file dialog's history into
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU
but i'm not sure if it is and will be always and the same way
is any function to get this?
(something line SHGetSpecialFolderPath(CSIDL_HISTORY) but for this case)
thanks
t!
|
|
|
|
|
Do you mean, last files for a specific app, or the last file as shown in the Windows menu Start/Documents ?
~RaGE();
|
|
|
|
|
last files for file dialog (for specific extension)
(look into mentioned registry entry)
t!
|
|
|
|
|
Debug into CRecentFileList::ReadList() and you'll see where your app's MRU list comes from.
|
|
|
|
|
sorry
i have no CRecentFileList (and it uses pApp->...ProfileString and needs to call CRecentFileList::Add)
i want to work with values what uses file dialog and i found them into mentioned registry
t!
|
|
|
|
|
When using a Windows Common Control, recently used files are saved to the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU key. To my knowledge, changing this is out of your control, so it should be safe to use.
|
|
|
|
|
thanks, it seems i will be not the first who will use it (directly)
t!
|
|
|
|
|
i wrote an application that do something with the incoming messages via the Windows Messenger Service (net send).
in that i just find the Messenger diaog and then read the mesage frm it and add to my application list control.
for that i uses EnumWindows() and FindWindow()APIS. this will work in all time but when i lock my workstation (using NT/2000) that will not work. i want to add those messages even i lock the workstation...
the problem is we can only use those two API'S based on the desktop window...is any alternate method/ideas?
Thanks in advance,
Regards
Renji
CodeTheDreams();
|
|
|
|
|
service??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
no..notservice...
i just take the message from the netsend dialog by using the EnumWindows() or FindWindow() API. they will work only when the desktop is active. i can't get that when the user lock his workstation.
i want a method which will works even the workstation is in locked state..
thats my requirement..hope that now u got the idea..eh naa..???
CodeTheDreams();
|
|
|
|
|
why dont u make ur application a service, so it works even if the desktop is locked or no one had logged in yet
That's what i meant
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
u man..!!!!!
even now u can't gasp what i am really says..!!!!
U know the netsend.exe ???
eg: netsend papa "hello"
if you sned a message like this will popup a Messenger Service window in papa(machinename /login name).
but this sort of messages while the time of working is so iriitating, so i just write an application to gather the content of the message and add in to a list. tat appplication is wrote as a tray.
the method i used to findout the messenge rpopup window is EnumWinodws() API. this can only enumerate the window(including the messenger window)when the time user works on the machine (that is in the unlocked mode). when the user lock the workstation(ctrl+alt+delete) that api doesnot works....i want an alternative method/idea...
hope that now you got what i am really want..!!!!
thats all aboy that...
regards
renji
CodeTheDreams();
|
|
|
|
|
Dear Friends,
I am using OPENFILENAME to open a file particular .ext file like this....
OpenFileName.lpstrFilter = "XVD files\0*.xvd;0*.vg2";
But along with this I would like to display the list of available files by their name and size too.
But I couldn`t able to do this.
Please write to me immediately.
Thanking You in advance.
So kindly help me to display
|
|
|
|