|
|
Up |
|
|
  |
Author: galapogosgalapogos
Date: May 7, 2007 20:34
On May 8, 1:25 am, Kellie Fitton YAHOO.COM> wrote:
> On May 6, 8:44 pm, galapogos gmail.com> wrote:
>
>
>
>> Hi,
>
>> I'm writing a console program to directly read from and write to an
>> external USB HDD in sector level(so that I can access the drive w/o it
>> even being initialized/partitioned/formatted, and I'm wondering how to
>> get started. I've only done file level I/O before on directly
>> connected drives so I'm not sure how to identify the USB drive(USB
>> VID/
>> PID/serial number maybe?) and also how to address it directly. Are
>> there any primers for this to help me get started?
>
>> I tried playing around with GetLogicalDrives(),
>> GetLogicalDriveStrings() and CreateFile(), but these seem to work at
>> the logical level, so I don't know exactly which physical drive I'm
>> accessing. ...
|
| Show full article (2.83Kb) |
|
| |
no comments
|
|
  |
Author:
Date: May 7, 2007 19:12
Vitor wrote:
> case WM_INITDIALOG:
>
> HWND list;
> list = GetDlgItem(hwnd, IDC_LIST);
>
> for(int lp = 0; lp != 4; lp++){
> SendMessage(list, CB_ADDSTRING, lp,
> reinterpret_cast((LPCTSTR)str[lp]));
> }
> SendMessage(list, CB_SETCURSEL, 1, 0);
> break;
>
> case WM_COMMAND:
> switch(LOWORD(wp)){
>
> case IDOK:
> if(number > 4){number = 4;}
> if(number < 1){number = 1;}
> numPlayers = number; ...
|
| Show full article (1.48Kb) |
|
| |
no comments
|
|
  |
Author: VitorVitor
Date: May 7, 2007 19:03
Peter Mason wrote:
> Vitor wrote:
> <...>
>> BOOL CALLBACK newProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp){
> <...>
>> int number;
> <...>
> <...> switch(msg){
>> case WM_COMMAND:
>> switch(LOWORD(wp)){
>>
>> case IDOK:
>> if(number > 4){number = 4;}
>> if(number < 1){number = 1;}
>> numPlayers = number;
>> EndDialog(hwnd, TRUE);
>> return true;
>> break;
>> }
>> case IDC_LIST: ...
|
| Show full article (3.21Kb) |
|
no comments
|
|
  |
Author: Peter MasonPeter Mason
Date: May 7, 2007 18:20
Vitor wrote:
<...>
> BOOL CALLBACK newProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp){
<...>
> int number;
<...>
<...> switch(msg){
>
> case WM_COMMAND:
> switch(LOWORD(wp)){
>
> case IDOK:
> if(number > 4){number = 4;}
> if(number < 1){number = 1;}
> numPlayers = number;
> EndDialog(hwnd, TRUE);
> return true;
> break;
> }
> case IDC_LIST: ...
|
| Show full article (1.79Kb) |
|
no comments
|
|
  |
Author: peter.mcclymontpeter.mcclymont
Date: May 7, 2007 16:53
Hi There,
I am having trouble calculating the height in pixels of a font that I
am drawing onto a windows form. I am using C++ in a win32 environment.
I am trying to centre the text between 2 known y positions on the
screen.
I am using CreateFont, and the first parameter is the height we want
the font to be in pixels. Of course though this is scaled to the
nearest point value (e.g. 8pt is the closest, or 9pt is the closets
etc), so it doesn't necessarily end up being the exact size of what is
passed in.
The problem then is when I call GetTextExtentPoint32 on the device
context where the font is already selected it gives me a value which
is more than what the text actually is when I measure the pixels in
paint.
The same thing happens with GetTextMetrics. I realise that the
function GetTextMetrics returns this data,
LONG tmAscent;
LONG tmDescent;
|
| Show full article (1.63Kb) |
|
2 Comments |
|
  |
Author: VitorVitor
Date: May 7, 2007 15:17
[Jongware] wrote:
>>> switch (msg)
>>> case WM_COMMAND:
>>> switch (LOWORD(wp))
>>> case IDC_LIST:
>>> switch (HIWORD(wp))
>>> case CBN_SELCHANGE:
>>> ...so you read the combo box if and only if you get WM_COMMAND with
>>> IDC_LIST with CBN_SELCHANGE.
>> IMHO, this is too complicated, prone to errors, hard to maintain, hard
>> to understand...
>>
>> I strongly suggest the GWH from www.beotel.net/~gwh
>>
>> With GWH, you create a message map:
>> WM_COMMAND, MAKELONG (IDC_LIST, CBN_SELCHANGE),
>> _IDC_LIST__CBN_SELCHANGE
>> ...
|
| Show full article (1.25Kb) |
|
no comments
|
|
  |
Author: VitorVitor
Date: May 7, 2007 15:14
Scott McPhillips [MVP] wrote:
> Vitor wrote:
>>
>> Thanks again for the help. I did get to run with some changes:
>> SendMessage(list, CB_GETLBTEXT, sel,
>> reinterpret_cast((LPCTSTR)czBuffer));
>> number = atoi(czBuffer);
>>
>> It did run but as far as I can tell It didn't put return the int to
>> number. Here is what I have so far, comments are just what I have
>> been experimenting with.
>>
>> #include
>>
>> #include "game.h"
>>
>> extern int numPlayers;
>>
>> static int number;
>> ...
|
| Show full article (2.86Kb) |
|
no comments
|
|
  |
Author: thomas.mertesthomas.mertes
Date: May 7, 2007 13:14
Hello,
I have released a new version of Seed7: seed7_05_20070507.tgz
In the Seed7 programming language new statements and operators
can be declared easily. Types are first class objects and therefore
templates/generics need no special syntax. Object orientation is
used when it brings advantages and not in places when other
solutions are more obvious.
Seed7 is covered by the GPL (and LGPL for the Seed7 runtime library).
|
| Show full article (1.09Kb) |
|
1 Comment |
|
  |
Author: Jakub DebskiJakub Debski
Date: May 7, 2007 09:01
Charlie Gibbs wrote :
> Unfortunately, I do have a good reason. There is a hardcoded limit
> of 50 open files in the run-time library. We have applications
> which open a number of files which is not known until run time;
> this number may exceed 50 (or any hardcoded limit). So it looks
> as if I'm going to have to go to the Win32 API after all, at least
> for these dynamically-allocated files that I'm using. And this,
> in turn, means that I'm going to have to do all of the unbuffering,
> etc. that's needed to create my own equivalent of fgets. Sigh...
Then change compiler to a better one...
regards,
Jakub
|
| |
|
no comments
|
|
  |
|
|
  |
Author: Gernot FrischGernot Frisch
Date: May 7, 2007 08:25
Hi,
I want to draw to the desktop, but clip all the application windws
that are above it.
Sort of - draw onto the wallpaper.
GetD(NULL); can draw over all windows, but I want to clip them.
--
-Gernot
int main(int argc, char** argv) {printf
("%%silto%%c%%cf%%cgl%%ssic%%ccom%%c", "ma", 58, 'g', 64, "ba", 46, 10);}
|
| |
|
1 Comment |
|
|
|
|
|
|