Search found 708 matches

by UEZ
Apr 07, 2021 11:10
Forum: Beginners
Topic: First attempt with Winsock2, failed by the way
Replies: 5
Views: 208

Re: First attempt with Winsock2, failed by the way

Try this:

Code: Select all

#INCLUDE "win/winsock2.bi"

DIM As WSADATA WinSockData
DIM RetVal AS Integer
RetVal = WSAStartup(WINSOCK_VERSION, @WinSockData)
IF RetVal THEN
  PRINT "Error: " & RetVal
ELSE
  PRINT "No Error"
END If
WSACleanup()
SLEEP
by UEZ
Apr 05, 2021 17:22
Forum: General
Topic: Bresenham thick line code
Replies: 3
Views: 389

Re: Bresenham thick line code

Thanks Pitto for your reply.

Very interesting approachs. I like the idea with the two triangles. Thanks for sharing it. :-)

It's time that the FB GFX lib will be upgraded to a modern one...
by UEZ
Apr 01, 2021 13:33
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

ENABLE_MOUSE_INPUT may help, perhaps ENABLE_EXTENDED_FLAGS Or (cmode And (Not ENABLE_QUICK_EDIT_MODE Or Not ENABLE_MOUSE_INPUT))) Look at https://gist.github.com/rururutan/5998ad0a5bb02d7e2352b3974868fcc3 Unfortunately not - when I click on rmb the popup menu appears and when I paste the clipboard ...
by UEZ
Mar 31, 2021 19:42
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

I'm on this path: #Include "windows.bi" Sub SetConsoleSize(cols As Long, lines As Long) Shell "MODE CON: COLS=" + Str(cols) + "LINES=" + Str(lines) End Sub Dim Shared As HWINEVENTHOOK gHook Sub HandleWinEvent(hook As HWINEVENTHOOK, Event As DWORD, hwnd As HWND, idObject...
by UEZ
Mar 31, 2021 11:17
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

Thanks dodicat but it works a long as you don't have anything in the clipboard. After the code is started and you put something to the clipboard you can paste it again.
Further, I don't want to clear the clipboard because maybe the data is needed.
by UEZ
Mar 31, 2021 9:47
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

Any idea how to block the context menu when pressing the rmb on the console window? #Include "windows.bi" Sub SetConsoleSize(cols As Long, lines As Long) Shell "MODE CON: COLS=" + Str(cols) + "LINES=" + Str(lines) End Sub Dim As DWORD cmode Dim As HANDLE hInput = GetStd...
by UEZ
Mar 30, 2021 10:58
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

You can disable it e.g. this code: #Include "windows.bi" Dim As DWORD cmode Dim As HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE) GetConsoleMode(hInput, @cmode) SetConsoleMode(hInput, ENABLE_EXTENDED_FLAGS Or (cmode And Not ENABLE_QUICK_EDIT_MODE)) ? "Press right mouse bottom" Di...
by UEZ
Mar 30, 2021 10:45
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

Oh my God, of course it pastes the stuff from the clipboard to the console. Image

I just wondered why it is different but it depends on what is in the clipboard.

Thx.
by UEZ
Mar 30, 2021 9:19
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Re: Inkey issue in console on rmb

I'm on Win10 but it happens also on Win7.
I took this screenhot as GIF anim:

Image

Sometimes alot of other chars will be printed.

This effect causes my Radio Station tool to drive crazy because of all the keystrokes. :-)
by UEZ
Mar 30, 2021 8:34
Forum: General
Topic: Inkey issue in console on rmb
Replies: 17
Views: 516

Inkey issue in console on rmb

When you compile this code as console and press the right mouse bottom inside the console then Inkey starts to return plenty of keystrokes. Dim As Long iPosCursor = Csrlin Dim As String key Do Locate iPosCursor, 1, 0 key = Inkey() ? key Select Case key Case Chr(27), Chr(113) 'ESC or q to exit progra...
by UEZ
Mar 25, 2021 20:34
Forum: Tips and Tricks
Topic: Radio Stations v0.49 build 2021-04-12 beta [Windows only]
Replies: 5
Views: 579

Re: Radio Stations v0.45 build 2021-03-25 beta [Windows only]

Update to v0.45: beside some internal changes I added the feature to download current song by pressing 'd' key.

Check out my 1st post for download / source code.
by UEZ
Mar 19, 2021 11:25
Forum: Windows
Topic: Example using ws2tcpip troubles
Replies: 9
Views: 322

Re: Example using ws2tcpip troubles

Copy and paste a page to get .txt and .html. (The default page is https://www.freebasic.net/forum/index.php) dim as string g g += "Const TriStateTrue = -1 ' forUnicode support"+chr(10) g += "URL = InputBox(""Enter (or paste) the URL to extract the Code ""&vbcr...
by UEZ
Mar 18, 2021 21:58
Forum: Windows
Topic: Example using ws2tcpip troubles
Replies: 9
Views: 322

Re: Example using ws2tcpip troubles

I don't know if you've managed to see the connection, but the reason your first post and SNC return 301 responses and JJs and the VBS work is because the site is redirecting non secure requests to HTTPS. Your code (and presumably SNC too) doesn't handle redirects and/or TLS, while those higher leve...
by UEZ
Mar 18, 2021 17:51
Forum: Windows
Topic: Example using ws2tcpip troubles
Replies: 9
Views: 322

Re: Example using ws2tcpip troubles

@Joshy: I tested SNC but somehow I didn't get it work to grab the source code of a web site. I know that SNC uses similar function, can you see the bug in the code I posted? Using your code ... ' test of a client connection const as string ServerName = "remix.kwed.org" const as string Serv...
by UEZ
Mar 18, 2021 14:00
Forum: Windows
Topic: Example using ws2tcpip troubles
Replies: 9
Views: 322

Example using ws2tcpip troubles

I want to have an alternative to WinHTTP API to read out the source code of a web site. I tried to convert a C++ example from here to FB but it doesn't work properly. The reply from server is HTTP/1.1 301 Moved Permanently Server: nginx/1.18.0 (Ubuntu) Date: Thu, 18 Mar 2021 13:58:56 GMT Content-Typ...

Go to advanced search