|
|
Is there a function in C++ that lets you chanche or increase the size of the windoe when a program is running? (like for example in windows 95 where there is no way to scroll down if the output goes ove 20 lines?)
|
|
|
|
This will make your screen full screen
#include <windows.h>
#include <iostream>
BOOL NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
SCDMProc_t SetConsoleDisplayMode;
HMODULE hKernel32;
BOOL bFreeLib = FALSE, ret;
const char KERNEL32_NAME[] = "kernel32.dll";
hKernel32 = GetModuleHandleA(KERNEL32_NAME);
if (hKernel32 == NULL)
{
hKernel32 = LoadLibraryA(KERNEL32_NAME);
if (hKernel32 == NULL)
return FALSE;
bFreeLib = true;
}//if
SetConsoleDisplayMode =
(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
if (SetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
DWORD dummy;
ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_SetConsoleDisplayMode
int main( void )
{
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
std::cin.get();
return 0;
} |
|
|
|
|
|
This will make your screen full screen
#include <windows.h>
#include <iostream>
BOOL NT_SetConsoleDisplayMode(HANDLE hOutputHandle, DWORD dwNewMode)
{
typedef BOOL (WINAPI *SCDMProc_t) (HANDLE, DWORD, LPDWORD);
SCDMProc_t SetConsoleDisplayMode;
HMODULE hKernel32;
BOOL bFreeLib = FALSE, ret;
const char KERNEL32_NAME[] = "kernel32.dll";
hKernel32 = GetModuleHandleA(KERNEL32_NAME);
if (hKernel32 == NULL)
{
hKernel32 = LoadLibraryA(KERNEL32_NAME);
if (hKernel32 == NULL)
return FALSE;
bFreeLib = true;
}//if
SetConsoleDisplayMode =
(SCDMProc_t)GetProcAddress(hKernel32, "SetConsoleDisplayMode");
if (SetConsoleDisplayMode == NULL)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
ret = FALSE;
}//if
else
{
DWORD dummy;
ret = SetConsoleDisplayMode(hOutputHandle, dwNewMode, &dummy);
}//else
if (bFreeLib)
FreeLibrary(hKernel32);
return ret;
}//NT_SetConsoleDisplayMode
int main( void )
{
NT_SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), 1 );
std::cin.get();
return 0;
} |
|
|
|
|
|
I have a coupon Web site which presents hundreds of coupon codes per page. I want people to be able to copy a code to their clipboard by simply clicking on it debit card. I can do this with the code below.
The divs with the class "multiple" are clickable. When clicked, the text they contain is copied to the user's clipboard.
Can anyone tell me, please, how I can incorporate window.open() so that, when a div is clicked, not only is the code copied to the user's clipboard but the site to which the code belongs is opened in a new window?
For example, imagine that on my page I present one code for eBay and another for Amazon. When a user clicks on, say, the Amazon code credit card, I want the Amazon code to be copied to the user's clipboard and Amazon.com to be opened in a new window.
I have tried adding window.open() as an onclick event. However, I only managed to get it to work with one div, not multiple.
Any suggestions will be appreciated. I've been stuck on this since yesterday.
####################################
<html>
<head>
<style type="text/css">
body { font-family:arial,sans-serif; font-size:9pt; }
div.multiple {
float: left;
background-color: white;
width:200px; height:200px;
border:1px solid #ccc;
margin:5px;
cursor: pointer;
font-size: 14pt;
}
div.multiple.hover {
background-color: #ddd;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="ZeroClipboard.js"></script>
<script language="Javascript">
var clip = null;
loans
function init() {
// setup single ZeroClipboard object for all our elements
clip = new ZeroClipboard.Client();
clip.setHandCursor( true );
// assign a common mouseover function for all elements using jQuery
$('div.multiple').mouseover( function() {
// set the clip text to our innerHTML
clip.setText( this.innerHTML );
// reposition the movie over our element
// or create it if this is the first time
if (clip.div) {
clip.receiveEvent('mouseout', null);
clip.reposition(this);
}
else clip.glue(this);
// gotta force these events due to the Flash movie
// moving all around. This insures the CSS effects
// are properly updated.
clip.receiveEvent('mouseover', null);
} );
}
</script>
</head>
<body onLoad="init()">
<div class="multiple">CODE</div>
<div class="multiple">CODE</div>
<div class="multiple">CODE</div>
<div class="multiple">CODE</div>
</body>debt consolidation
</html>
|
|
|
|
|
|
|
|