Search found 3447 matches

by MichaelW
May 30, 2006 23:25
Forum: Beginners
Topic: Variable for opening com port
Replies: 18
Views: 4763

'***************************************************************** option explicit #include once "windows.bi" declare function GetLastError alias "GetLastError"() as DWORD dim hCom as handle dim com as zstring * 4 => "COM" dim commPort as zstring * 5 dim n as i...
by MichaelW
May 30, 2006 20:02
Forum: Beginners
Topic: Variable for opening com port
Replies: 18
Views: 4763

I posted some related code here: http://www.freebasic.net/forum/viewtopic.php?t=4309 The code calls GetCommState , but does not display any of the values returned in the DCB structure. Oops, you asked for port status, not the configuration state. Let me see what I can find. There is GetCommModemStat...
by MichaelW
May 30, 2006 19:48
Forum: Windows
Topic: Get Open Process
Replies: 5
Views: 2133

Not a single function, but several combined. This is a quick and dirty port of the first part of the example here . Tested under v0.15b and Windows 2000 only. #include once "windows.bi" #include once "win\tlhelp32.bi" option explicit dim hProcessSnap as HANDLE dim hProcess as HAN...
by MichaelW
May 30, 2006 19:08
Forum: Beginners
Topic: Variable for opening com port
Replies: 18
Views: 4763

You could try using the API directly. In my tests the FB OPEN COM and the API equivalents do not produce the same results.
by MichaelW
May 30, 2006 9:00
Forum: Windows
Topic: Text Calendar, International
Replies: 10
Views: 5628

There is no single API function to do it, but it can be done with the current API. Use this at your own risk, and you really should backup your registry before you start playing with it. I always do ;) #define unicode #include once "windows.bi" #inclib "advapi32" ' Not in v0.15b ...
by MichaelW
May 29, 2006 16:48
Forum: General
Topic: What are the shortes posible value of an allocated pointer?
Replies: 13
Views: 2014

I'm not sure this will provide an answer because I'm not exactly sure what the question is. #include once "windows.bi" #include once "win\wtypes.bi" #include once "win\unknwn.bi" #include once "win\oleauto.bi" option explicit dim as byte ptr hGlo, gloPtr, hHea...
by MichaelW
May 29, 2006 12:31
Forum: Linux
Topic: Help with a traduction from QB to FB
Replies: 2
Views: 1197

I don't recall any such syntax for QBasic, QuickBASIC, PDS, or VBDOS.
by MichaelW
May 29, 2006 10:35
Forum: General
Topic: get pixel color
Replies: 13
Views: 2200

While I’m focused on this, the macros are preferable not only because they are convenient, but because they expand to efficient in-line code. The three macro calls in the source below expand to this: mov al, byte ptr [_COLVAL] movzx eax, al mov dword ptr [_R], eax mov ax, word ptr [_COLVAL] movzx ea...
by MichaelW
May 29, 2006 10:23
Forum: General
Topic: get pixel color
Replies: 13
Views: 2200

Yes, that could well be, I’m using v0.15b downloaded early this month. But the new header files are for version 0.16, and unless 0.16 is now stable, I’m not ready to move up. The windef.bi file appears to be unchanged, and the only difference for windows.bi is that the new version does not include a...
by MichaelW
May 29, 2006 8:15
Forum: General
Topic: get pixel color
Replies: 13
Views: 2200

Sorry, I should have explained better. If I try to compile this: #include once "windows.bi" option explicit dim cref as COLORREF 'cref = RGB( 1,2,3 ) cref = point(1,1) print hex$( cref ) print GetRValue( cref ) print GetGValue( cref ) print GetBValue...
by MichaelW
May 28, 2006 5:13
Forum: General
Topic: get pixel color
Replies: 13
Views: 2200

Mr. Eddy, POINT will return a color index for <= 256 colors, and an RGB value for true color modes. Assuming you are running Windows, for RGB values there are macros defined in wingdi.bi that can extract the red, green, and blue components. #include once "windows.bi" option explicit dim cr...
by MichaelW
May 27, 2006 19:44
Forum: General
Topic: FMOD
Replies: 8
Views: 928

by MichaelW
May 27, 2006 17:54
Forum: General
Topic: Need Help with serial comunication
Replies: 3
Views: 1766

Hello Antoni,

Thanks for the welcome. I don’t know about the guru stuff, but yes, I’m that Michael Webster.
by MichaelW
May 27, 2006 9:42
Forum: General
Topic: Need Help with serial comunication
Replies: 3
Views: 1766

Your OPEN statement is not syntactically correct for FB. On my Windows 2000 SP4 system I have two serial ports (actually UARTs). COM1 is an unused serial port, and COM2 is hardware modem. This code will succeed only for COM3: open com "COM3:4800,n,8,1,rs" as 1 if err then print "OPEN ...
by MichaelW
May 26, 2006 12:35
Forum: Beginners
Topic: LOCATE function
Replies: 11
Views: 2187

Under Windows XP and later you can switch between full screen and windowed mode at run time with the SetConsoleDisplayMode function. The function actually works under Windows 2000 SP4, but the value returned in lpNewScreenBufferDimensions (65292, 18 on my system) seems a little strange. #include onc...

Go to advanced search