|
Use MoveWindow or SetWindowPos in the appropriate message handlers (I suppose you have MFC, so this must be in OnCreate , OnOpen and so on. I am not so familiar with SDI/MDI)
~RaGE();
|
|
|
|
|
hey guys,
just wondering if any of you guys happen to visit the C# forum any, as I posted a question there hoping someone could help, but it seems that no one in the C# world can, or i'm just asking for the wrong info...
either way just wondering if someone could go check it out and see if they know anything...
here's the link:
http://codeproject.com/script/comments/forums.asp?forumid=1649&fr=76&select=1312256#xx1312256xx[^]
I'm basicly trying to find a way to access info on my hardware that i know exist, have found it using other software tools, and would like to reproduce with my own code. I understand that I may run into a problem trying to access this info through managed code, so if any of you know which "yellow brick road" to follow and are willing to help me out I would appreciate it TREMENDOUSLY!!!
Thanks in advance
Merry Christmas,
Happy Hanukkah!
-
string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
HI,
i have a problem with this function...
void show(){
int hour,minu,sec;
char time1;
hLUIseDLL = LoadLibrary("LUIse.dll");
if (hLUIseDLL != NULL)
{
LUI_OpenDevice = (T_LUI_OpenDevice)GetProcAddress(hLUIseDLL, "LUI_OpenDevice");
LUI_CloseDevice = (T_LUI_CloseDevice)GetProcAddress(hLUIseDLL, "LUI_CloseDevice");
LUI_DispOnOff = (T_LUI_DispOnOff)GetProcAddress(hLUIseDLL, "LUI_DispOnOff");
LUI_CCFL = (T_LUI_CCFL)GetProcAddress(hLUIseDLL, "LUI_CCFL");
LUI_GetContrast = (T_LUI_GetContrast)GetProcAddress(hLUIseDLL, "LUI_GetContrast");
LUI_SetContrast = (T_LUI_SetContrast)GetProcAddress(hLUIseDLL, "LUI_SetContrast");
LUI_OutPort = (T_LUI_OutPort)GetProcAddress(hLUIseDLL, "LUI_OutPort");
LUI_InPort = (T_LUI_InPort)GetProcAddress(hLUIseDLL, "LUI_InPort");
LUI_LCDmode = (T_LUI_LCDmode)GetProcAddress(hLUIseDLL, "LUI_LCDmode");
LUI_Bitmap = (T_LUI_Bitmap)GetProcAddress(hLUIseDLL, "LUI_Bitmap");
LUI_Text = (T_LUI_Text)GetProcAddress(hLUIseDLL, "LUI_Text");
LUI_BMPfile = (T_LUI_BMPfile)GetProcAddress(hLUIseDLL, "LUI_BMPfile");
LUI_SetPixel = (T_LUI_SetPixel)GetProcAddress(hLUIseDLL, "LUI_SetPixel");
LUI_GetSerial = (T_LUI_GetSerial)GetProcAddress(hLUIseDLL, "LUI_GetSerial");
GetDllVersion = (T_GetDllVersion)GetProcAddress(hLUIseDLL, "GetDllVersion");
LUI_ScreenRefreshControl = (T_LUI_ScreenRefreshControl)GetProcAddress(hLUIseDLL, "LUI_ScreenRefreshControl");
LUI_TouchScreen = (T_LUI_TouchScreen)GetProcAddress(hLUIseDLL, "LUI_TouchScreen");
}else MessageBox(0,"DLL Error","Error", MB_OK);
LUI_OpenDevice(0)
LUI_TouchScreen(0,mouse);
do{
if(mouse[1]<300){
CTime t=CTime::GetCurrentTime();
sprintf(&time1,"%d:%d:%d",t.GetDay(),t.GetMinute(),t.GetSecond());
parser.data=&time1;
parser.draw();
LUI_TouchScreen(0,mouse);
Sleep(200);
}while(mouse[1]<=300);
LUI_CloseDevice(0);
Sleep(200);
FreeLibrary(hLUIseDLL);
}
the debugger says that the stack around the time1 is corrupted(runtime errot #2), but...what to do?
when i set the configurationmode to "release", it runs, but time1 isn't the value.
please help me...
thanks
-- modified at 8:29 Wednesday 21st December, 2005
|
|
|
|
|
try the following declaration: char time1[64];
and replace &time1 by just time1.
you are writing too many chars in your time1 in the sprintf.
|
|
|
|
|
|
sorry toxxcct, your solution worked(thx), but i'm a beginner in visual c++ (i programmed borland before) and i hate this type conversion.
|
|
|
|
|
iiscodered wrote: i hate this type conversion.
if you don't like it, you won't like programming C++ sir !!!
[edit]
i don't know who is that anonymous who voted me 1 for this answer, but here is the point. In C++, we have to manage ourselves the memory allocation/dealocation on the heap, so, when one tells that he doesn't like this way of programming, it makes me laugh because it's a bigger part of the C++ usage...
now if that poor guy cannot show off himself, shame on him.
[/edit]
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 3:36 Thursday 22nd December, 2005
|
|
|
|
|
Hello,
I need to determine the pixel color of a certain area of the screen including the cursor icon.
The GetPixel function receives the pixel color _under_ then cursor
Any ideas?
Thank you in advance,
Mat.
-- modified at 7:32 Wednesday 21st December, 2005
|
|
|
|
|
Maybe you can find an hint in this article :
Link[^]
I am not positive, yet.
~RaGE();
|
|
|
|
|
Thank you for your reply but this version does the same
I'm using quite unsuccessfully right now. It captures any
pixel but the cursor icon
Mat.
|
|
|
|
|
You need to get the cursor bitmap, offset into the bitmap from the cursor x/y origin to the location you wish to extract and read the bitmap colors.
Try
ICONINFO sIconInfo;
GetIconInfo(GetCursor(),&sIconInfo));
to extract the image and reference the image via sIconInfo.bmColor member.
onwards and upwards...
|
|
|
|
|
u use the Getpixel for picture dc
happy new year
|
|
|
|
|
or read the RGBQUADs directly...
onwards and upwards...
|
|
|
|
|
I tried to initalise a structure in the class
by
struct tagBITMAPFILEHEADER
{
WORD bfType=0; // must be 'BM'
DWORD bfSize=0; // size of the whole .bmp file
WORD bfReserved1=0; // must be 0
WORD bfReserved2=0; // must be 0
DWORD bfOffBits=0;
}m_BITMAPFILEHEADER ;
there is an error displayed as
error C2252: 'bfType' : pure specifier can only be specified for functions
How to initialise in a class any help
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
vikas amin wrote: How to initialise in a class
Is this working?
struct tagBITMAPFILEHEADER
{
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
}m_BITMAPFILEHEADER = {0,0,0,0,0};
~RaGE();
|
|
|
|
|
vikas amin wrote: WORD bfType=0; // must be 'BM'
DWORD bfSize=0; // size of the whole .bmp file
WORD bfReserved1=0; // must be 0
WORD bfReserved2=0; // must be 0
DWORD bfOffBits=0;
You cannot init members like that inside a structure.
Create an instance and then initialize the members
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
to be more complete, writing such a thing tell the compiler that the members are pure virtual (which is here definitely wrong).
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
Game over
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
in the constructor , init the strcut variable = {val,val2,...).(positional refernce)
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
Mr vikas,
it's the second time i see this question from you. if you continue asking it exactly the same way, you will get exactly same answers...
to go further in help, i'd like to see how you exactly try to initialize your struct (give a piece a code were you do it, and DON'T FORGET : round your code samples with <pre></pre> tag to help us see you code better !!)
moreover, as it has already been suggested, there are 2 ways to do this :
1st :
m_BITMAPFILEHEADER = { 0, 0, 0, 0, 0 };
2nd :
m_BITMAPFILEHEADER.bfType = 0;
m_BITMAPFILEHEADER.bfSize = 0;
m_BITMAPFILEHEADER.bfReserved1 = 0;
m_BITMAPFILEHEADER.bfReserved2 = 0;
m_BITMAPFILEHEADER.bfOffBits = 0;
if you try to initialize this in your class constructor, did you try also to use the first method in the initilizer list of the constructor ?
<font color=blue>class</font> MyClass {
<font color=blue>private</font>:
<font color=blue>struct</font> tagBITMAPFILEHEADER {
<font color=green>
tagBITMAPFILEHEADER(<font color=blue>const</font> tagBITMAPFILEHEADER&); <font color=green>
} m_tagBITMAPFILEHEADER;
<font color=blue>public</font>:
MyClass()
: m_tagBITMAPFILEHEADER({ 0, 0, 0, 0, 0 }) {
<font color=green>
}
};
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
You could write a constructor into the structure itself, so whenever that structure is created, it's properly initialized:
struct tagBITMAPFILEHEADER
{
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
tagBITMAPFILEHEADER::tagBITMAPFILEHEADER()
{
bfType = 0;
bfSize = 0;
bfReserved1 = 0;
bfReserved2 = 0;
bfOffBits = 0;
}
};
Now you could have in your header:
tagBITMAPFILEHEADER *m_pBMHeader;
and when you create it
m_pBMHeader = new tagBITMAPFILEHEADER;
the constructor will be called and your values will be initialized.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I want to offer a user a list of folders to choose from. The user should be able to use the arrow keys to scroll up and down so that the current choice is highlighted. They should also be able to choose using the number keys.
Thanks
KevinSheedy
|
|
|
|
|
To get a list of folders, you could use _findfirst() , _findnext() etc to get the needed folder list.
A- Display the list using printf() , cout etc.
B- Write a while loop which takes input from the user, and interprets the key pressed. (you could use getch() ).
C- Highlight the current selection. (Now that is a problem):
1- You could put some special character ahead of the selected line.
2- You could dig deep into VC and find just the right technique to change the backcolor of the text, or the text itself. (If it is possible)
3- Something else.
Is that your homework?
this is this.
|
|
|
|
|
Hi. Thanks, that helps. I guess the highlighting part isn't all that important. You know when windows gives you the option to boot from safe mode, safe mode with CD support or boot normally etc. It lets you scroll up and down with the arrows. I just thought there might be some simple function that lets you do that. If there's no easy way, I can just prompt the user to pick a number or something like that. It's not worth wasting too much time over.
KevinSheedy
|
|
|
|
|
Just a little comment:
The windows menu that appears comes from real-mode DOS (I think) So, there are endless possibilites of what you can do with real-mode DOS OS; you can write directly to memory, set the foreground and background colors, blink text, ... anything. But with protected mode OSes, they don't let you write directly to any arbitrary memory location.
this is this.
|
|
|
|
|