|
Thanks for your reply. Your references are to the point; although maybe not since none of them seem to apply to property pages embedded with an OCX. In the dialog box, I set the Tab Control to WS_EX_CONTROLPARENT with WS_TABSTOP, but it made no difference.
The property pages are embedded in the Tab Control using CoCreateInstance to get a ISpecifyPropertyPages pointer, which is used to get a CAUUID, which is used to get an array of IPropertyPage pointers from more calls to CoCreateInstance, one for each property page.
Probably what I need to do is trap the Tab message in the dialog box, then somehow see if the property page with the edit controls is open, see if the focus is in an edit control, and if it is, send the Tab message to the property page. I don't know how to do that yet, but your answer stimulated some thinking. It seems like a lot of work for an apparently simple task..
|
|
|
|
|
Try reading this[^]. You're doing something simple wrong, it shouldn't be hard to get what you're trying to do to work.
Steve
|
|
|
|
|
Hi All!
I am trying to playback a '.wav' file, which I have no problem with doing using the MCI. What I need to do is know when playback has finished. I have now spent a day looking in to this and not found anything anywhere - please help!!!
Is using MCI the best way of doing this - I only wish to play, stop and pause sound files (mp3, wav and spx), nothing too clever, but detecting the end of the soundfile has proven to be a problem.
I am using VC6 & Windows XP
Any help and advice would be greatly appreciated!
Regards
Mike
|
|
|
|
|
Right I have had some success, but still need a bit of advice!
I have overridden WindowProc, and when the wav file starts and stops, I recieve message 1224. I can then check the wParam and lParam to see the value. lParam is 525 when the wav file finishes playing.
Does anyone know what is the definition of message 1224, and what are returned in wparam \ lparam?
Thanks for any advice on this
Regards
Mike
|
|
|
|
|
|
Thanks for helping Cool_Dev
I did think about doing this in a similar manner - setting a 1 second timer running and checking to see the position of playback to see if the end of file had been reached. It did strike me as being a bit in-elligent. I was hoping for there to be a 'MCI_NOTIFY_PLAYBACK_FINISHED' type of message that I would need to capture. I don't know if you have seen my reply to my own post - I have had some success in getting a message, but I just have the value - it would be nice to know its definition.
Thanks for lookingg and your advice
Mike
|
|
|
|
|
I have a CComboBox control :
CComboBox* pCombo = (CComboBox*)GetDlgItem(IDC_COMBO1);
and here I fill it :
pCombo->AddString("One");
pCombo->AddString("Two");
pCombo->AddString("Three");
pCombo->AddString("Four");
pCombo->AddString("Five");
and here , in drop down state I want to delete an item ( or two ) :
pCombo->ShowDropDown(TRUE);
pCombo->DeleteString(2);
pCombo->DeleteString(3);
my question is : how can I redimension the drop down window to fit remain items ?
I solve this in dirty way :
pCombo->ShowDropDown(FALSE);
pCombo->ShowDropDown(TRUE);
but is not elegant and in some systems flikering ... can you help me ?
|
|
|
|
|
Try it reverse :
pCombo->DeleteString(2);
pCombo->DeleteString(3);
pCombo->ShowDropDown(TRUE);
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Yes , it is an solution , but in my case is imposible : in OnEditupdateCombo1 handler , depends of some conditions , while combo box is allready in drop down state , I insert / remove items ...
|
|
|
|
|
Please see the function ::GetComboBoxInfo(..) ,
you can access the list in this way
and then move it at the new calculated position
(bottom -= GetItemHeight(..)*delCount)
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
I use VC6 , so I have not access to GetComboBoxInfo method ... but I try to retrieve rect drop down window information with GetDroppedControlRect(...) method ... I write you if I succeed it ! Thank you !
|
|
|
|
|
// I use VC6...
It should be possible :
void CYourDialog::Test()
{
CComboBox* pcBox = (CComboBox*) GetDlgItem(IDC_COMBO1);
if (pcBox->GetSafeHwnd()) {
pcBox->ShowDropDown(TRUE);
COMBOBOXINFO sCBINFO = {0};
sCBINFO.cbSize = sizeof(COMBOBOXINFO);
if (::GetComboBoxInfo(pcBox->GetSafeHwnd(), &sCBINFO)) {
if (sCBINFO.hwndList) {
CWnd* pcList = CWnd::GetFromHandle(sCBINFO.hwndList);
CRect cListRect;
pcList->GetWindowRect(cListRect);
cListRect.bottom -= 20;
pcList->MoveWindow(cListRect);
}
}
}
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
I will try this , but tomorrow morning , and I will write you . Thank you !
|
|
|
|
|
I have tried it too,
you can call the function at any time :
void CYourDialog::AdjustComboBox(CComboBox* pcBox)
{
if (pcBox->GetSafeHwnd()) {
COMBOBOXINFO sCBINFO = {0};
sCBINFO.cbSize = sizeof(COMBOBOXINFO);
if (::GetComboBoxInfo(pcBox->GetSafeHwnd(), &sCBINFO)) {
if (sCBINFO.hwndList) {
CWnd* pcList = CWnd::FromHandle(sCBINFO.hwndList);
CRect cListRect;
pcList->GetWindowRect(cListRect);
cListRect.bottom = cListRect.top;
pcList->MoveWindow(cListRect);
}
}
}
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
mesajflaviu wrote: I use VC6 , so I have not access to GetComboBoxInfo method...
What are you saying? GetComboBoxInfo() has existed since Windows 98, about the same time that VS6 came out.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
At my method list of CComboBox I have not this method : GetComboBoxInfo() ...
|
|
|
|
|
You're letting IntelliSense dictate what you (don't) have access to?
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
As GetComboBoxInfo requires windows 98 or above, make sure corresponding platform sdk is with you. I think February-2003 version is the last one that can be neatly compiled by VC6 compiler.
Also just ensure that the #define WINVER in your program meets the windows version for GetComboBoxInfo in winuser.h.
|
|
|
|
|
I have not installed any SDK ... this meen I can't solve the problem without SDK ? My VS6 is naked !
|
|
|
|
|
int m_MaxHeightItems = 10;
int visibleItemCount = m_MaxHeightItems < nNumEntries ? m_MaxHeightItems : nNumEntries;
CRect rectExpanded;
pCombo->GetClientRect(rectExpanded);
rectExpanded.bottom += visibleItemCount * pCombo->GetItemHeight(0);
rectExpanded.bottom += GetSystemMetrics(SM_CYEDGE) * 2;
pCombo->SetWindowPos(NULL,
0, 0,
rectExpanded.Width(), rectExpanded.Height(),
SWP_NOMOVE | SWP_NOZORDER
);
|
|
|
|
|
I want to make myself an AutoComplete combo box ... but I give up and use this[^] solution ... thank you all !
|
|
|
|
|
Dear all,
I have a console application that writes data to shared network drives. No problem if I launch it from command prompt or Windows explorer. But things go wrong if I call it from a Windows service created with sc command, The appliaction runs in memeory that is for sure, but for some reason it cannot get acess to network drives. ( both the console application and the windows service are wriiten in VC8 )
Please Help
Regards
|
|
|
|
|
Please, do not cross post. Yu have already got an answer here[^]
|
|
|
|
|
Thanks, But I need to know How to use my CreateProcess function from the service so that it can read or write any loaction on the system.
|
|
|
|
|
Hi,
The reason why you are able to access the drive in when you normally run the executable from command prompt is that when u are executing it as normal exe you are running that application in the User account from which you have logged on . And that user has the privileges to access the network. But , when you install the executable as a service , by default if you see in the task manage it runs under 'SYSTEM' account . And you might be knowing that the 'SYSTEM' doesn't have rights to access network resources.
There can be two solutions to this problem.
1. As Sauro Viti already pointed out in the link he gave you , to map the drive as persistent.
2. There is one more approach that can be followed. If you open the service manager by typing in the 'services.msc'you can go to your service and in the properties of your service there is a logOn tab where you can specify the account as any other account than 'System' you can either start service from your own logged on user account or through 'Network Service'. When you do this .. the service can access any network component and drive even if they are not persistent also.
To achieve this programmatically you can look into 'CreateService' function at
http://msdn.microsoft.com/en-us/library/ms682450(v=vs.85).aspx and can set the parameter 'lpServiceStartName ' to 'NT AUTHORITY\NetworkService'. This will start your service under 'Network Service' account and then you are done.
3. You can also try by making the service as interactive by specifying SERVICE_INTERACTIVE_PROCESS in the servicetype parameter flag of your CreateService() function but this will be limited only till XP as Vista and 7 donot support this feature.
Hope the solutions help you.. Let me know if this worked for you .
-Kushagra
|
|
|
|