Resource scripts.

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

The Web Warrior Guide to Web Design Technologies
Lecture 2 Introduction to C Programming
Introduction to C Programming
Adobe Photoshop 6 Advanced Level Course. Easy Fixes Photoshop is the best tool to fix old, torn and faded photographs, and can fix almost all flaws in.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Console Application Programming Brian Hendricks. Getting Started On the web –New user help adcon.fnal.gov/controls/clib/new_user.html –Library help adcon.fnal.gov/controls/libraries.html.
A First Program Using C#
Several Ways to Print in Windows 98 by Ralph Godinez.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Getting Started The structure of a simple wxWidgets program, Look at where and how a wxWidgets application starts and ends, how to show the main window,
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
1 Chapter 12: Form Builder Objects and Flexible Code.
GAM666 – Introduction To Game Programming You must use special libraries (aka APIs – application programming interfaces) to make something other than a.
CITA 342 Section 2 Visual Programming. Allows the use of visual expressions (such as graphics, drawings, or animation) in the process of programming.
Chapter Three The UNIX Editors.
Work with Tables and Database Records Lesson 3. NAVIGATING AMONG RECORDS Access users who prefer using the keyboard to navigate records can press keys.
Modal Dialogs. What is a Modal Dialog? A modal dialog is a separate window that remains in focus until it is closed by the user. During this time the.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
OST Intro in to Macs. History of Macintosh On January 24, 1984 Apple Computer introduced the Apple Macintosh personal computer, with the Macintosh.
National Diploma Unit 4 Introduction to Software Development Procedures and Functions.
Chapter 1 slides1 What is C? A high-level language that is extremely useful for engineering computations. A computer language that has endured for almost.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
Tarik Booker CS 120 California State University, Los Angeles.
Chapter 3: Mastering Editors Chapter 3 Mastering Editors (Emacs)
Windows 7 and file management
Chapter 2: The Visual Studio .NET Development Environment
Chapter 1: Introduction to computers and C++ Programming
CSC201: Computer Programming
A bit of C programming Lecture 3 Uli Raich.
Key Ideas from day 1 slides
Computing Fundamentals
Chapter 2 - Introduction to C Programming
Windows Programming Lecture 09.
Window.
18 & 19.
Guide To UNIX Using Linux Third Edition
Basic operations in Matlab
Chapter 3 Software Interfaces.
C Basics.
Chapter 2 - Introduction to C Programming
Choice of Programming Language
More on Graphical User Interfaces
Fundamentals of Python: From First Programs Through Data Structures
Exploring the Basics of Windows XP
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.
Variables and Arithmetic Operations
Computer Organization & Compilation Process
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
WEB PROGRAMMING JavaScript.
Chapter 2 - Introduction to C Programming
Exploring the Basics of Windows XP
Handles disk file 0000: array of file-offsets 0001: 0002: 0003: 0: …
Using JDeveloper.
Chapter 2 - Introduction to C Programming
Programming Fundamentals Lecture #3 Overview of Computer Programming
Chapter 2 - Introduction to C Programming
C – Programming Language
Computer Organization & Compilation Process
SPL – PS2 C++ Memory Handling.
Presentation transcript:

Resource scripts

rc.exe Windows SDK has a special tool – rc.exe – resource script compiler.

What is it? File containing GUI data and when compiled can be linked with program. When linked, program can use data in resource scripts (e.g. version, icon, etc.)

Resource types drop-down menu popup menu strings keyboard accelerators icons bitmap images dialog boxes Version mouse cursors

Before we start... RS syntax is similar to taht of C. For example, rc.exe uses standard C preprocessor. It is possible to write macro commands Header file “resource.h”.

Using resources... Load* functions: LoadString LoadIcon etc... We need to know instance handle of executable.

MAKEINTRESOURCE Resources has a name, which can be string or numeric identificator. On numeric case number can not be longer than 16 bits. When addressing resource we use name – unikodine string... To not confuse numeric identificator with string, the macro MAKEINTRESOURCE is used, which converts an integer value to a resource type compatible with the resource-management functions.

Prefixes for resource names IDS – string IDM – menu IDC – command IDD – dialog IDA – accelerators IDI – icon or bitmap IDB – bitmap ID – unknown type

DISCARDABLE To free memory from unused resources. This keyword in 32 bits Windows systems is ignored.

Icons Keyword ICON: Executable will use first icon if there are few of them:

Header file: Loading icon from executable: Alternatively with string:

WNDCLASSEX has two types of icons: big and small WNDCLASSEX has two types of icons: big and small. Small icon is made from 16x16 px, big – 32x32 px. If small icon is not provided – big icon is reduced. If we use NULL handle, Windows will return default icon.

Bitmaps Bitmaps can be used as icons: Size of bitmaps can be big, thus Windows can return NULL value. Remove bitmaps from memory by passing on the handle to function DestroyObject.

Mouse cursors Cursors are defined similar to icons and loaded with the function LoadCursor.

String tables Strings are defined in the next way: It possible to use BEGIN... END instead of { }.

Table is loaded with function LoadString: hInst – handle of library, containing string uID – identificator of string lpBuffer – array to acquire strings value nBufferMax – how many characters should be read Function returns number of characters read.

Accelerators Accelerators are common part of almost all software. Accelerators table is described as such:

Examples Keys combinations are defined as characters or virtual key’s value:

VIRTKEYS

If accelerators are related with menu commands, then menu command will reveal on pressing accelerator, unless we use a keyword NOINVERT:

LoadAccelerators Accelerators are loaded with LoadAccelerators function:

TranslateAccelerator For program to “understand” accelerators message loop should be changed. Function TranslateAccelerator changes keys values to relevant command messages

When multiple document interface (MDI) program is written, we need to react to subwindows accelerators. Function TranslateMDISysAccel is used:

Menu

Ampersand (&)

Version Version information is stored in resource file:

Dialogs Dialog window has such structure:

Dialog example