|
How can i restrict resizing of my application at run time?
|
|
|
|
|
kiranin wrote: How can i restrict resizing of my application at run time?
Handle WM_GETMINMAXINFO .
|
|
|
|
|
This work only when we using maximize button,
but what am i asking is when we r about to change the size with the mouse
by dragging........ at that situation it is to be fixed
|
|
|
|
|
kiranin wrote: This work only when we using maximize button,
but what am i asking is when we r about to change the size with the mouse
by dragging........ at that situation it is to be fixed
I don't know why you say this... It's working perfectly here though...
LRESULT CResizeDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if( message == WM_GETMINMAXINFO )
{
LPMINMAXINFO lpMM = ( LPMINMAXINFO )lParam;
<code>lpMM->ptMinTrackSize.x = 200;
lpMM->ptMinTrackSize.y = 200;
return 0;
}
return CDialog::WindowProc(message, wParam, lParam);
}
|
|
|
|
|
|
while reciving data and printing it in edit box i need to write it in txt file but only few fields not all can you help me to do that..
Code i am using for .txt file and printnig data in edit box.
I have made the comment line before the code to be correct.
<br />
void CWartz_newDlg::OnPriceChangeArielapictrl1(LPCTSTR SessionId, LPCTSTR RequestId, short MarketNo, LPCTSTR Market, LPCTSTR Bid, short BidDirection, LPCTSTR Ask, short AskDirection, LPCTSTR High, LPCTSTR Low, short MarketState, LPCTSTR Timestamp) <br />
{<br />
<br />
CString csMarket="EURUSD";<br />
CString usMarket ="USDJPY";<br />
CString gbMarket="GBPUSD" ;<br />
<br />
sessionid=SessionId;<br />
CurrentRequestId=RequestId;<br />
CString MarketSt,a,b,c,d;<br />
<br />
a.Format("%d",MarketNo);<br />
b.Format("%c",BidDirection);<br />
c.Format("%c",AskDirection);<br />
d.Format("%d",MarketState);<br />
<br />
<br />
<br />
<br />
m_MainEdit=m_MainEdit + SessionId + RequestId + a ; <br />
m_MainEdit=m_MainEdit + Market + Bid + b +Ask + c + High ;<br />
m_MainEdit=m_MainEdit + Low + d +"\t" + Timestamp + "\r\n";<br />
<br />
UpdateData(FALSE);<br />
iLineCount=m_EditCtrl.GetLineCount();<br />
m_EditCtrl.LineScroll(iLineCount);<br />
<br />
<br />
if(csMarket== Market)
{<br />
myfile.Open("EurUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
myfile.SeekToEnd();<br />
myfile.Write((LPCTSTR)m_MainEdit,m_MainEdit.GetLength()*sizeof(TCHAR));<br />
myfile.Close();<br />
<br />
}<br />
<br />
else if(usMarket == Market)<br />
{<br />
myfile.Open("UsdJpy.txt",CFile.modeCreate | CFile.modeWrite);<br />
LPSTR buf1;<br />
int i = m_MainEdit.GetLength();<br />
buf1 = m_MainEdit.GetBuffer(i);<br />
myfile.Write(buf1,i);<br />
myfile.Close();<br />
}<br />
<br />
else if(gbMarket == Market)<br />
{<br />
myfile.Open("GbpUsd.txt",CFile.modeCreate | CFile.modeWrite);<br />
LPSTR buf2;<br />
int i = m_MainEdit.GetLength();<br />
buf2 = m_MainEdit.GetBuffer(i);<br />
myfile.Write(buf2,i);<br />
myfile.Close();<br />
<br />
}<br />
}<br />
<br />
-- modified at 1:18 Thursday 21st September, 2006
|
|
|
|
|
abrakadbra wrote: // THIS ARE THE FIELD RECIVING FROM REMOTE SERVER
// And I need only 4 fields to save on txt file according to market like //Market,Bid,High,Low,
m_MainEdit=m_MainEdit + SessionId + RequestId + a ;
m_MainEdit=m_MainEdit + Market + Bid + b +Ask + c + High ;
m_MainEdit=m_MainEdit + Low + d +"\t" + Timestamp + "\r\n";
So only assign those four to m_MainEdit . What's so hard about that? If you need m_MainEdit in some other spot with all of the fields, just create another variable.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
I write some application, and in some place in the code i need to know if some specific window dialog is open.
I will explain ... i have some dialog that have time out to close ( after X second this dialog is close ) my question is ... how can i know by know the dialog ID or dialog class variable if the current window is open/show of hide ?
Thanks for any help.
|
|
|
|
|
|
You may use IsWindowVisible( )
MyDlg DlgObj; // Your Dialog object
if( !DLgObj.IsWindowVisible( ))
{
AfxMessageBox( "Dialog is hidden" )
}
else
{
AfxMessageBox( "Dialog is shown" )
}
Rinu Raj
|
|
|
|
|
Yanshof wrote: Hi All
I write some application, and in some place in the code i need to know if some specific window dialog is open.
I will explain ... i have some dialog that have time out to close ( after X second this dialog is close ) my question is ... how can i know by know the dialog ID or dialog class variable if the current window is open/show of hide ?
Thanks for any help.
Loop through child windows of the dialog, use GetWindow and GetNextWindow for this purpose and test to see if this is a dialog window or not.
Or use EnumChildWindows .
|
|
|
|
|
Yanshof wrote: ...i have some dialog that have time out to close ( after X second this dialog is close )...
Have you consulted this article?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello!! i want to know whether inp() and outp() fnction work on Windows98?? if no, then can i know if there are any alternatives to these functions that can be used for programming in windows98?? Thanks...
vijay.
|
|
|
|
|
these are compatible with WIN95 ... and I think should work on WIN98.
The answer is Good!
|
|
|
|
|
Hello sir!! Thanks for replying. but are u sure that they will work. even i believed they will work. but they are not working. so i just want to confirm whether they will work on Windows98.
vijay.
|
|
|
|
|
No Sir! these functions are just Compatible with WIN95 (I saw in MSDN-April 2005)
|
|
|
|
|
aroli vijay wrote: so i just want to confirm whether they will work on Windows98.
According to MSDN, they are compatible with Windows 98 et al.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If you are writing to and reading from an external port such as COM1, COM2, LPT1 etc. the better alternative is to use the CreateFile, WriteFile, ReadFile Windows API functions. However, i think that Windows does not allow low-level access to ports in user mode(surely true on NT systems). Then you will have to switch to kernel-mode or another tool.
|
|
|
|
|
i was trying to read a sector of data from the Hard disk using the base address of the Hard disk controller. i am not able to read data from the hard disk. i was using inp() and outp() functions. they dont seem to work in windows98. can u please suggest me any alternatives?? thanks..
vijay.
|
|
|
|
|
I guess you are trying to access a crashed hard disk. Anyway, to my knowledge, if you're trying to run the program in a Windows platform, the OS will deny this operation (An error will pop-up). If you just want to run the program in Windows, you would need to work on kernel-mode programming, a rather cumbersome work . Try booting your PC with DOS only, your program should run..!
|
|
|
|
|
hello sir!! thanks for the information. yes, i am trying to acces a disk and yes, my code works fine in DOS environment. but i want to write the code that does the same work, but in a windows98 enviroment (not in windows XP/NT/2000). i am ready to do the Kernel-mode programming. can u please suggest me what to do?? how should i start and how to proceed?? and hey, i just now read that _outp(), _inp()are compatible with windows 98.. check out the following link..
http://msdn2.microsoft.com/en-us/library/733szwah.aspx[^]
-- modified at 9:20 Thursday 21st September, 2006
vijay.
|
|
|
|
|
aroli vijay wrote: i was trying to read a sector of data from the Hard disk...
So why not simply call CreateFile("\\\\.\\C:", ...) or CreateFile(“\\\\.\\PhysicalDrive0”, ...) to open disk and then use ReadFile() to read disk sector by sector.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi all,
I am trying to develop an application that interacts with a console mode application. First I created the console, ran the cmd.exe on it and redirected the Standard input so that my app can write value to the command processor. All goes well until I write to the console, in this case my text does not appear on the command prompt. When I debug, I see that WriteFile() is successful and the desired no. of bytes are written to the console handle. Can anyone identify what I am missing from the code I've used below.(echo is on by default, isn't it?). As u can see, I'm trying to display "hi" on the command prompt...!
AllocConsole();<br />
HANDLE hInRead, hInWrite,hInWriteDup;
HANDLE hOutRead,hOutWrite,hOutReadDup;
HANDLE hSavedOut=GetStdHandle(STD_OUTPUT_HANDLE);<br />
<br />
SECURITY_ATTRIBUTES sa;<br />
sa.bInheritHandle=TRUE;<br />
sa.lpSecurityDescriptor=NULL;<br />
sa.nLength=sizeof(SECURITY_ATTRIBUTES);<br />
<br />
CreatePipe(&hInRead,&hInWrite,&sa,0);<br />
CreatePipe(&hOutRead,&hOutWrite,&sa,0);<br />
<br />
DuplicateHandle(GetCurrentProcess(),hInWrite,GetCurrentProcess(),&hInWriteDup, 0,<br />
FALSE,DUPLICATE_SAME_ACCESS);<br />
DuplicateHandle(GetCurrentProcess(),hOutRead,GetCurrentProcess(),&hOutReadDup, 0,<br />
FALSE,DUPLICATE_SAME_ACCESS);<br />
CloseHandle(hInWrite);<br />
CloseHandle(hOutRead);<br />
hInWrite=INVALID_HANDLE_VALUE;<br />
hOutRead=INVALID_HANDLE_VALUE;<br />
<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);<br />
si.hStdInput = hInRead;
si.hStdError = GetStdHandle(STD_ERROR_HANDLE);<br />
si.wShowWindow = SW_SHOW;<br />
si.dwFlags = STARTF_USESTDHANDLES| STARTF_USESHOWWINDOW;
<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
<br />
if(!::CreateProcess(NULL,"cmd",<br />
NULL,NULL,FALSE,CREATE_NEW_PROCESS_GROUP,
NULL,<br />
NULL,&si,&pi))<br />
AfxMessageBox("Process Error",MB_ICONERROR,0);<br />
DWORD num;<br />
if(!WriteFile(hInWriteDup,"Hi",3,&num,NULL))<br />
AfxMessageBox("Write to pipe failed",MB_ICONERROR,0);
|
|
|
|
|
how can i access a file locked by other application
i think if i hook the application, and capture the file io message
but how can i do
someone could help me? thanks a lot
|
|
|
|
|
You can't. The file system is what's locking you out.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|