|
Goh Hui Beng wrote:
CAN SOMEONE EXPLAIN TO ME THIS SET OF CODE
no, I won't, at least not right now, please ask a more specific question, what's the problem, what exactly you don't understand ?
it seems to be quite explicit ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
ok my problem is that i want this code to output some specific points like iLipBottomX the coordinate value.
but this code actually detects and draws out the picture.
From this can u deduce wat variable must i printf to get the result i want?
The SMouthFeature structure contain these variable
bool bMouthFound; // Mouth finding flag
bool bSplMouthFound; // Mouth spline finding flag
HSPLINE hSpl_mouth; // Mouth spline handle
bool bSplLipTopFound; // Top lip spline finding flag
HSPLINE hSpl_lip_top; // Top lip spline handle
bool bSplLipBottomFound; // Bottom lip spline finding flag
HSPLINE hSpl_lip_bottom; // Bottom lip spline handle
bool bLipTopFound; // Top lip point finding flag
int iLipTopX; // x coordinate of the top lip point
int iLipTopY; // y coordinate of the top lip point
bool bMouthCenterFound; // Mouth center finding flag
int iMouthCenterX; // x coordinate of the mouth center
int iMouthCenterY; // y coordinate of the mouth center
bool bLipBottomFound; // Bottom lip point finding flag
int iLipBottomX; // x coordinate of the bottom lip point
int iLipBottomY; // y coordinate of the bottom lip point
bool bMouthLeftCornerFound; // Mouth left corner finding flag
int iLeftCornerX; // x coordinate of the mouth left corner
int iLeftCornerY; // y
u understand or do u need further info i can provide
|
|
|
|
|
Hi
in my application i try to set an printer fonts.From msdn i took this example how it do.
CHOOSEFONT cf;
LOGFONT lf;
HFONT hfont;
// Initialize members of the CHOOSEFONT structure.
cf.lStructSize = sizeof(CHOOSEFONT);
cf.hwndOwner = (HWND)NULL;
cf.hDC = (HDC)NULL;
cf.lpLogFont = &lf;
cf.iPointSize = 0;
cf.Flags = CF_SCREENFONTS;
cf.rgbColors = RGB(0,0,0);
cf.lCustData = 0L;
cf.lpfnHook = (LPCFHOOKPROC)NULL;
cf.lpTemplateName = (LPSTR)NULL;
cf.hInstance = (HINSTANCE) NULL;
cf.lpszStyle = (LPSTR)NULL;
cf.nFontType = SCREEN_FONTTYPE;
cf.nSizeMin = 0;
cf.nSizeMax = 0;
// Display the CHOOSEFONT common-dialog box.
ChooseFont(&cf);
// Create a logical font based on the user's
// selection and return a handle identifying
// that font.
hfont = CreateFontIndirect(cf.lpLogFont);
//After this i has hfont variable vary by NULL,and try to
//select it into printer device context m_hPrinterDC
//(this variable was initialized early and
//also have a proper value,because of when i output text
//on one or do any other acts all work fine.
//In this step i try to select created logical font into dc
HGDIOBJ hf1 = SelectObject(m_hPrinterDC,&hfont);
//This function return NULL,what meant an error.
Where is my fault?????
Also i try to change some params in cf structure like this:
cf.hDC = m_hPrinterDC;
cf.Flags = CF_PRINTERFONTS;
cf.nFontType = PRINTER_FONTTYPE;
But result exactly same.
Thanks.
|
|
|
|
|
Search Article on Microsoft website -> "How To Use Printer Device Fonts"
It might be of help, if need to use Printer Font.
|
|
|
|
|
I create followng:
CDialog dlg;
dlg.Create(IDD.pWnd);
dlg appears, but I neeed to hide it,
I made following:
but no resilt,
how to do it?
<br />
int cWaitDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)<br />
{<br />
<br />
<br />
this->ModifyStyle(WS_VISIBLE,0,0);<br />
<br />
lpCreateStruct->style |= WS_VISIBLE;<br />
lpCreateStruct->style -= WS_VISIBLE;<br />
<br />
this->ShowWindow(SW_HIDE);<br />
<br />
if (__super::OnCreate(lpCreateStruct) == -1)<br />
return -1;<br />
<br />
<br />
<br />
return 0;<br />
}<br />
<br />
BOOL cWaitDlg::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
<br />
cs.style |= WS_VISIBLE;<br />
cs.style -= WS_VISIBLE;<br />
<br />
int j = cs.style & WS_VISIBLE;<br />
<br />
return __super::PreCreateWindow(cs);<br />
}<br />
<br />
<br />
|
|
|
|
|
vgrigor wrote:
this->ModifyStyle(WS_VISIBLE,0,0);
lpCreateStruct->style |= WS_VISIBLE;
lpCreateStruct->style -= WS_VISIBLE;
this->ShowWindow(SW_HIDE);
What are you trying to do here? If you want the window to be hidden, why not just remove the WS_VISIBLE style from the dialog template? Otherwise, the code you have makes no sense. Note this may not work as CDialog::OnInitDialog() "shows" the window explicitly.
vgrigor wrote:
if (__super::OnCreate(lpCreateStruct) == -1)
Is this a construct for Windows CE? Just curious.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Removing style not prevent from appearing,
so that even I hide by comman Window will flick one moment,
and that is problem.
Need to to appear at any.
Until commanded else.
|
|
|
|
|
vgrigor wrote:
Removing style not prevent from appearing...
I suspected such.
vgrigor wrote:
Need to to appear at any.
Until commanded else.
What does this mean?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Sorry I did notinitially
typed text question:
now I added it:
I create followng:
CDialog dlg;
dlg.Create(IDD.pWnd);
dlg appears, but I neeed to hide it,
with no any time of apperiance,
I made following: code above...
but no resilt,
how to do it?
|
|
|
|
|
Derive a class from CDialog using the dialog template. In that class' constructor, call Create(IDD) .
CMyDialog *pDlg;
...
pDlg->ShowWindow(SW_SHOW);
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Why create a dialog any way when its going to be hidden? why not create a window using CreateWindow api???
or derive a class from CWnd class and then create it so that you have the power of message mapping of MFC
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
Mr.Prakash wrote:
Why create a dialog any way when its going to be hidden?
Why ask me? It's not my project.
Yes, hidden windows do have their place.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
DavidCrow wrote:
Why ask me? It's not my project.
oops sorry i replied to the wrong post.
I have lost more blood shaving than on the battlefield - Adolf Hitler
|
|
|
|
|
It is interesting,
how to use this API for CDialog ?
How to define sizes?
|
|
|
|
|
|
|
Somebody dropped me right solution.
I did not detected who.
Thanks:
http://www.codeproject.com/dialog/dlgboxtricks.asp
|
|
|
|
|
You can replace all of your code with a single overriden function and two lines of code
void CMyDlg::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
// This is where it all happens
if(!m_bShowWindow)
lpwndpos->flags &= ~SWP_SHOWWINDOW;
CDialog::OnWindowPosChanging(lpwndpos);
}
Simply turn off m_bShowWindow (which obviously needs to be defined and switched) to show the window. This code prevents the dialog from ever being seen in the first place. Unfortunately Win98, Win95 still seem to briefly flicker before disappearing...but who is running those OS's anyway
Hope this information is not too late for others searching the message boards...
|
|
|
|
|
Hi!
My project used a CListCtrl for displaying a list. This list had the extended styles LVS_EX_ONECLICKACTIVATE and LVS_EX_UNDERLINEHOT (think of the list as a menu). Now I have to replace this list by a CTreeCtrl. The tree now, of course, doesn't underline the hot items any more and the one-click functionality also doesn't work any more.
Now my question: what message must I send to the tree control to behave like the list before? I've already searched MSDN, but didn't find anything. It must be possible, I have some applications that can do this...
Thanks in advance,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
try this
SetWindowLong(hTreeWnd,GWL_STYLE,GetWindowLong(hTreeWnd,GWL_STYLE) | TVS_TRACKSELECT);
Hope it helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hope it helps
It did!!
Thank you very much!
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
I have be assigned a project which has to have a graphical music keyboard which plays the corresponding note when the key is pressed, it also has to have a simple graphical editor to edit the notes. As i am new to all this i was wondering if anyone could give me any pointers of where to start and along what lines i should go about doing it. I am currently trying to interacted with DLL files to access the soundcard.
Any help would be much appreciated.
Mav
|
|
|
|
|
|
mavgoose wrote:
As i am new to all
new to what ? generic programming ? sound programming ? windows application ?
anyway, look for for some MIDI api ... and look around CP, there might be something interresting.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Mav,
It's a lot simpler than you think especially sounding the notes.
The majority of the work will be building a representation of the keyboard that responds to the mouse clicks, what do you mean by edit the notes??
You can use the MIDI API see http://www.borg.com/~jglatt/tech/lowmidi.htm. The sound API has functions that can sound midi output at a given pitch.
Its definitely the easiest way to get the notes sounding, the app itself will need to be threaded in order to sound multiple notes at once...
You will need to link you project to 'winnm.dll' to be able to call midiOutShortMsg() the simplest operation to sound a note. See the section on 'Outputting MIDI data (except System Exclusive)'
have a look at the article and get back to me regarding questions,
Ross W
|
|
|
|