|
How can i hide the toolbar on top of my dialog or window in and show it again ?
I am asking this to make a fullscreen toggling.
Thank you very much.
|
|
|
|
|
Do you need to m_wndToolBar.ShowWindow(0); ?
|
|
|
|
|
I think i wrote it wrong in my first message , i want to make my window borderless when it is in fullscreen mode.
|
|
|
|
|
I think the following should do it.
DWORD dw;<br />
dw = GetWindowLong(m_hWnd,GWL_STYLE);<br />
dw = dw & ~(WS_BORDER | WS_THICKFRAME | WS_CAPTION);<br />
<br />
SetWindowLong(m_hWnd,GWL_STYLE,dw);<br />
<br />
int x;<br />
int y;<br />
x = GetSystemMetrics(SM_CXSCREEN);<br />
y = GetSystemMetrics(SM_CYSCREEN);<br />
SetWindowPos(NULL,0,0,x,y,SWP_NOZORDER);
To restore it, do the opposite:
DWORD dw;<br />
dw = GetWindowLong(m_hWnd,GWL_STYLE);<br />
dw |= (WS_BORDER | WS_THICKFRAME | WS_CAPTION);<br />
<br />
SetWindowLong(m_hWnd,GWL_STYLE,dw);<br />
<br />
int x;<br />
int y;<br />
x = 500;<br />
y = 500;<br />
SetWindowPos(NULL,0,0,x,y,SWP_NOZORDER);
However, take care of your windows' Z-order if you need to.
this is this.
|
|
|
|
|
Thank you very much it worked but it doesnt work for the first time , but works for everytime after first. All i do is placing your code in OnLButtonDown
|
|
|
|
|
I am using VMR9 Filter for video rendering. But i must do some arrangements on this filter like :
"YUV mixing mode", "dynamic decimation", and "dynamic switch to BOB"
How can i set them on VMR9 Filter via directshow code ?
BEST REGARDS
|
|
|
|
|
Obtain a IVMRMixerControl9 interface to the VMR and use IVMRMixerControl9::SetMixingPrefs().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have to check whether the CTS signal and RTS Signal in serial port. I have modified my
dcb.fOutxCtsFlow=TRUE;
dcb.fRtsControl=RTS_CONTROL_ENABLE;
I am placing a LED between pin7(RTS) and pin5 for GND to check whether voltage occurs in that pin7. But no voltage occurs.
S.Yamini
|
|
|
|
|
what is your OS?
if your OS is windows XP/2003 or later , you can work with com/parallel port directly, because this ports close by Microsoft, you can use API for this work.
successful
|
|
|
|
|
My OS is Windows Xp. Can u tell me which API I can use
S.Yamini
|
|
|
|
|
|
Please give more details.
I think you need to:
1. Open the serial port (CreateFile)
2. Get the state of the DCB (GetCommState)
3. Set dcb.fOutxCtsFlow and dcb.fRtsControl
4. Set the state of the DCB (SetCommState)
Are you doing all of these?
|
|
|
|
|
I am sorry I have Placed my question wrong. I have to control a relay using serial port .The RTS and DTR should become high so that I control my relay.
S.Yamini
|
|
|
|
|
I meant, we need more details about what you are doing in your program - a longer code section, maybe.
Once you set the parameters in the DCB, did you do:
SetCommState(hPort, &dcb);
|
|
|
|
|
I am trying to control a relay via serial port using RTS and DTR pins in serial port . I have set these two pins high via VC++ coding or C. Can we suggest me something.
S.Yamini
|
|
|
|
|
It's difficult to help if you don't show what you are doing already. Maybe you are missing a step in your program, so the lines are not actually going high. If you are setting the pins high, maybe they can not supply enough current to turn on a relay.
Instead of using the control lines, what about using lines on a parallel port? Have a look at this article www.codeproject.com/useritems/PaPiC.asp[^] - it uses the InpOut32 library, which allows direct access to I/O ports.
|
|
|
|
|
hi how to edit boot configuration in vista using bcdedit.exe in mfc program. pls help me . its urgent
|
|
|
|
|
how to make my rich edit ctrl scroll automatically when insert new text?
here's how i insert text
<br />
msg.Insert( msg.GetLength() , "\n");<br />
m_system_message.SetSel(-1,-1);<br />
m_system_message.ReplaceSel(msg);
here's how the richedit is defined in the resource file
CONTROL "",IDC_SYSTEM_MESSAGE,"RICHEDIT",ES_MULTILINE | <br />
ES_AUTOVSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP,11,<br />
257,241,52
as you guys can see, ES_AUTOVSCROLL is definately there
but whenever i insert new text using ReplaceSel, the text focus is always at the top. how do i make it such that it automatically scrolls down to read the latest text inserted?
using
- mfc
- vc6.0
- winxp
thanks in advance!
|
|
|
|
|
|
I think ES_AUTOVSCROLL is there to help scroll the window when the user inputs text using the keyboard etc. But for automatic additions to the control, I think you could send it a message to scroll itself after adding text to it.
m_system_message.SendMessage(WM_VSCROLL,MAKEWPARAM(SB_BOTTOM,0));
Then it should scroll to the bottom, and the cursor, if in it, should appear at the end of the last line.
this is this.
|
|
|
|
|
Hi,
Can we get the address of a winAPI (from Advapi32.dll) without using GetProcAddress or IAT scan? Is it possible?
Basically, I want to obfuscate the api call in source code level.
Thanks,
GNU:lihd
|
|
|
|
|
But why you dont want to use GetProcAddress?
|
|
|
|
|
to obfuscate the api call in source code level.
If i can find the procAddress then i will obfuscate using assembly call and api redirections so that it would be harder to find out which API is being called (looking at the source).
|
|
|
|
|
Yes. This code should point you in the right direction. It outputs the names of all the functions exported by name from "Kernel32.dll":
#include "stdafx.h"
#include <iostream>
#include <windows.h>
LPVOID PrintFunctions(HMODULE hMod)
{
PIMAGE_DOS_HEADER pDOS = (PIMAGE_DOS_HEADER)hMod;
PIMAGE_NT_HEADERS pNew = (PIMAGE_NT_HEADERS)((char*)pDOS+pDOS->e_lfanew);
PIMAGE_OPTIONAL_HEADER pOpt = &(pNew->OptionalHeader);
PIMAGE_EXPORT_DIRECTORY pExport =
(PIMAGE_EXPORT_DIRECTORY)((char*)pDOS+pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
UINT_PTR *pNameArray = (UINT_PTR*)((char*)pDOS+pExport->AddressOfNames);
for (DWORD i=0; i<pExport->NumberOfNames; ++i)
{
LPCSTR pName = (LPCSTR)((char*)pDOS+pNameArray[i]);
std::cout << pName << std::endl;
}
return NULL;
}
int main(int arvc, char* argv[])
{
HMODULE hMod = GetModuleHandle("kernel32.dll");
PrintFunctions(hMod);
return 0;
}
Steve
|
|
|
|
|
Hi,
Where I could learn this kind of learning. Please point me to the right guides to do kernel/system programming?
|
|
|
|