NO

Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Assembly discussions / Macros for quick procedure definition
« Last post by Vortex on March 18, 2024, 07:54:20 PM »
Hello,

Here are some macros for quick procedure definition. The PROCX macro sets automatically the PARMAREA value :

Code: [Select]
PROCX MACRO functionname:REQ,args:VARARG

fname TEXTEQU functionname

    functionname PROC args PARMAREA=16*QWORD

ENDM

ENDPX MACRO

    fname ENDP

ENDM

The maximum number of parameters which is 16 by default can be modified easily.

An example :

Code: [Select]
PROCX start

LOCAL hModule:QWORD

    invoke  GetModuleHandle,NULL
    mov     hModule,rax
    invoke  DialogBoxParam,hModule,\
            ADDR Resource,NULL,ADDR DlgProc,NULL
    invoke  ExitProcess,rax

ENDPX
22
Assembly discussions / Manifest from command line
« Last post by Vortex on March 10, 2024, 06:50:03 PM »
Here is an example using a response file for Polink :

Manifest.rsp :

Code: [Select]
/manifest:embed
/manifestdependency:"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"
/manifestuac:"level='asInvoker' uiAccess='false'"

Code: [Select]
\PellesC\bin\poasm /AIA32 Window.asm
\PellesC\bin\polink /SUBSYSTEM:WINDOWS @Manifest.rsp /LIBPATH:\PellesC\lib\Win Window.obj
23
Work in progress / Re: High Performance 64-bit CPU Design
« Last post by John Z on March 10, 2024, 04:32:49 PM »
...  I have spent much of the last year designing a 64-bit CPU called Ď•Engine. ...

I applaud your ambition!  Other than my experience with Xilinx FPGA, many years ago, it is way way out of my zone.  But I look forward to trying it someday.

John Z

Are you limiting your possible collaborators by requiring LinkedIn? I stayed away from it, and especially after it became an arm of Micro$oft...
24
Beginner questions / Re: Select text for clipboard
« Last post by John Z on March 10, 2024, 04:25:41 PM »
Hi DonnyDave,

I think we keep circling the issue.  AFAIK using TextOut to the HDC draws the text in pixels on the DC using the current Font and colors.  The result is a picture of the text, the underlying characters used to draw the picture in terms of ASCII or Unicode character values are not stored anywhere to be retrieved with mouse highlighting and Ctrl+C.

To do that you would need to use a control like an edit box, or RichEdit control.  Using these controls the underlying text is preserved (stored),  The Cursor position can be set within the text display and text can be selected programmatically, Ctrl+C will then work to copy the selected text.

I could be wrong but doing a screen capture and then OCR is the only way I know of for retrieving text written using TextOut directly onto a DC.....If I am I'm sure we will here about it shortly  ;)  ;D

John Z
25
Beginner questions / Re: Select text for clipboard
« Last post by DonnyDave on March 09, 2024, 11:49:14 AM »
This is roughly what I'm trying to do:-

struct                               //  This structure holds every line to be displayed.
  {
  char Contents[MAX_TEXT];
  } DisplayBuffStruct[RTVNUMLINES];

// ------------------------------------------------

    case WM_PAINT :
        hdc = BeginPaint (hwnd, &ps);        // Prepare the window for painting.
// ****************************** Find painting limits ******************************.
          for (n = FirstLine; n <= LastLine; n++)
           {
            TextOut(hdc, 10, y), DisplayBuffStruct[n].Contents, StrLength);    //  Write a line of text from DisplayBuffStruct[].Contents to the client area.
           }
        EndPaint (hwnd, &ps);        // Indicate that painting is finished.
    return 0;


// ------------------------------------------------

void WatchStr(char *TheString, char *TheText)  //  This counts as a declaration of WatchStr()
  {
    if(strlen(TheString) > MAX_TEXT-1)
      {
      MessageBox(NULL, TEXT("Too Big !"), TEXT("WatchStr"), MB_OK);
      exit(0);
      }

    sprintf(DisplayBuffStruct[DispLine++].Contents, "%s = %s", TheText, TheString);


  InvalidateRect(hwnd, NULL, TRUE);
  }
// ------------------------------------------------


I want to copy a selected portion of the text from the screen to the clipboard.
26
Work in progress / Re: High Performance 64-bit CPU Design
« Last post by Vortex on March 08, 2024, 08:32:09 PM »
Another interesting operating system project, Solar OS :

http://www.oby.ro/os/index.html
27
Work in progress / Re: High Performance 64-bit CPU Design
« Last post by WiiLF23 on March 08, 2024, 08:24:58 PM »
Designing and implementing a custom operating system is discussed very thoroughly over YouTube. You'll likely be using fat.c with some assembly for the boot loader, registers and more. I would personally be more focused on the OS design, and basic hardware support before consulting a OS-dependent language, which I personally feel would be a logical choice in the full implementation of XYZ OS.

Windows core code never left C/ASM, so I would personally maintain these language fundamentals in the overall design.

Finally, it has already been done. This is called "TempleOS". 100% unique and not a derivative of any UNIX flavor.

Interesting story on this. HolyC (or C+) became the language the OS was written in, as well as the applications within the OS.

This may point the direction of what can be done. This one guy did it all by himself, period. It can be done. He had effective schizophrenia disorder, which just blows my mind. He is no longer with us.

"TempleOS is a 64-bit, non-preemptive multi-tasking, multi-cored, public domain, open source, ring-0-only, single address space, non-networked, PC operating system for recreational programming."
28
Beginner questions / Re: Select text for clipboard
« Last post by WiiLF23 on March 08, 2024, 06:38:55 PM »
I don't really understand the request here, but I am assuming a contextmenu or control that acts as a Copy/Paste for the target string (from Edit control or already stored in clipboard). Obtaining text from Edit control is easy, and you can also "watch" events such as focus and update (this is where you can count string length to perform checks, copy string or simply read string from Edit control among other actions).

This is how I pulled off a responsive Edit control (like typing into Facebook search, same idea - visually). And these events are required for this in my journey:

WM_LBUTTONDOWN
EN_SETFOCUS
EN_KILLFOCUS
EN_CHANGE


eg.
Code: [Select]
case WM_COMMAND:
     case MY_TEXT_CTRL: {
          switch (GET_WM_COMMAND_CMD(wParam, lParam)) {
               case EN_CHANGE: { ... break; }
               // Add more cases
               default:
                    break;
          }
     }
     break;

Just stuff to help. Any string copied into the clipboard is replaced with a new one effectively replacing the last string stored. This applies to OS in general, and all data types it supports for clipboard. Windows also watches and sanitizes copied objects and other data to ensure integrity and security. So it knows when a image is copied from the desktop (BLOB data likely) which allows to insert the image data into accepting applications (like Irfanview), etc.

Strings should be the easiest to work with.
29
Beginner questions / Re: Select text for clipboard
« Last post by DonnyDave on March 08, 2024, 05:55:57 PM »
John,
That's correct, I want to incorporate into a win10 prog. I'm about to write (using Pelles C).
Dave
30
Beginner questions / Re: Select text for clipboard
« Last post by John Z on March 08, 2024, 11:10:56 AM »
Hi DonnyDave,

Checking for understanding  -
You are envisioning that a program you wrote is running on a windows system.  This programs purpose is to allow the highlighting of any text displayed on the window screen from anything that is open and displaying some text in its own program?  It does this by first allowing the highlighting of the text using the mouse, then Ctrl+C is executed to copy to the clipboard.....

So -   Several huge hurdles to overcome, imo.

As an initial thing there is the fact that everything shown on the windows screen is only a picture composed of pixels.  There is actually no 'text' available on the screen there are only pictures of text shown.  It is the underlying program that retains/creates the text in 'characters' that are then transformed into pixels and drawn in the programs window display space. This is unlike days of old where the screen was actually a character map of say 24 x 80 that was actually filled with the 'character' to be displayed ie an 'A' in row 1 column 1 was a value of 65 which is capital A.  The underlying screen map could be accessed by any program.

So for your program to use the mouse to highlight some text in my program window you would need to have access to the underlying programs storage of the text being displayed so that character could be retrieved instead of a picture of the characters.

The next hurdle is the once the mouse is over a programs windows space that program controls what the mouse can do.  If hovering over my program and I don't have a routine to do highlighting, or changed the action of the mouse buttons, then there is no way for your program to do that highlighting without developing a hook or other method to intercept the mouse and do your task before sending the mouse to the underlying program. It is the same with the keyboard btw.  When over a programs window the keystrokes go to that window, so there would need to be a hook for that too...

There are intricate ways of doing some of the above but they are very involved. 

It would be a lot easier to program a screen capture program (there are many already) then send the screen picture through an OCR program to recover the 'text' as characters.

Hopefully I've not misunderstood your intention and just went on and on for nothing  ;D

John Z

Pages: 1 2 [3] 4 5 ... 10